hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8eab8b064c9e76464450980bd8d5e48a2c98df8b | 2,529 | py | Python | mnist_train.py | danielgolf/AI-playground | d1148da7a3ca42b788a7ba268d3367bca0803cb9 | [
"MIT"
] | null | null | null | mnist_train.py | danielgolf/AI-playground | d1148da7a3ca42b788a7ba268d3367bca0803cb9 | [
"MIT"
] | null | null | null | mnist_train.py | danielgolf/AI-playground | d1148da7a3ca42b788a7ba268d3367bca0803cb9 | [
"MIT"
] | null | null | null | import numpy as np
import keras
import keras.layers as layers
from get_mnist import get_mnist_preproc
### --- hyperparameterrs --- ###
epochs = 48
batch_size = 64
num_classes = 10
reg = 3e-3
### --- hyperparams end --- ###
### --- setup data --- ###
traini, trainl, vali, vall, testi, testl = get_mnist_preproc()
... | 19.453846 | 62 | 0.627521 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 577 | 0.228153 |
8eadce45d598833e81a4fe85012aa8463fefa8ba | 539 | py | Python | main.py | mir45ol/cyber-controller | b12399731d2cb66ae1209e0bfbde9fcc88ed3558 | [
"MIT"
] | 1 | 2022-01-30T01:17:05.000Z | 2022-01-30T01:17:05.000Z | main.py | mir45ol/cyber-controller | b12399731d2cb66ae1209e0bfbde9fcc88ed3558 | [
"MIT"
] | null | null | null | main.py | mir45ol/cyber-controller | b12399731d2cb66ae1209e0bfbde9fcc88ed3558 | [
"MIT"
] | 1 | 2022-02-05T20:17:01.000Z | 2022-02-05T20:17:01.000Z | import config
import controller
import hwrtc
import network
import web_server
import wlan
def main():
if config.wlan_ssid and config.wlan_password:
wlan.initialize_wlan()
wlan.connect_to_wlan()
hwrtc.initialize_hwrtc()
hwrtc.initialize_ds3231()
hwrtc.synchronize_hwrtc_ds3231()
co... | 20.730769 | 58 | 0.71243 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8eaeba892f2de5df103a615e0e9a36e8ab22471a | 25,480 | py | Python | c2cgeoportal/__init__.py | kalbermattenm/c2cgeoportal | 4ab41ec7130536bc86f4c05ca330e9ce3dfb93c1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/__init__.py | kalbermattenm/c2cgeoportal | 4ab41ec7130536bc86f4c05ca330e9ce3dfb93c1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/__init__.py | kalbermattenm/c2cgeoportal | 4ab41ec7130536bc86f4c05ca330e9ce3dfb93c1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2016, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
#... | 35.586592 | 98 | 0.672567 | 2,524 | 0.099054 | 0 | 0 | 0 | 0 | 0 | 0 | 9,583 | 0.376084 |
8eaf5d71da4aea86f6032fa830b38828a3ca197e | 1,102 | py | Python | app/cruds/seeds.py | woods0918/graphql_server_sample | b19e57fedb8cdb41ee001c8e80ef4baeebc8fe99 | [
"MIT"
] | null | null | null | app/cruds/seeds.py | woods0918/graphql_server_sample | b19e57fedb8cdb41ee001c8e80ef4baeebc8fe99 | [
"MIT"
] | null | null | null | app/cruds/seeds.py | woods0918/graphql_server_sample | b19e57fedb8cdb41ee001c8e80ef4baeebc8fe99 | [
"MIT"
] | null | null | null | import sys
import pathlib
from datetime import datetime
current_dir = pathlib.Path(__file__).resolve().parent
sys.path.append( str(current_dir) + '/../../' )
from app.database import BASE, ENGINE, session_scope
from app.models.todos import Todo
from app.models.users import User
def generate_seed_data():
BASE.met... | 29.783784 | 54 | 0.57804 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 175 | 0.157092 |
8eaf99475c5184ec13f9c69b29833abb9f843b06 | 3,217 | py | Python | tests/test_rogue_web.py | bfontaine/rogue_scores | 894f118de81e91246a114a0bc3ed74de2edd3cc8 | [
"MIT"
] | null | null | null | tests/test_rogue_web.py | bfontaine/rogue_scores | 894f118de81e91246a114a0bc3ed74de2edd3cc8 | [
"MIT"
] | 5 | 2019-11-04T09:00:39.000Z | 2021-03-30T06:44:26.000Z | tests/test_rogue_web.py | bfontaine/rogue_scores | 894f118de81e91246a114a0bc3ed74de2edd3cc8 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import os
import os.path
import json
import platform
import tempfile
import logging
if platform.python_version() < '2.7':
import unittest2 as unittest
else:
import unittest
from rogue_scores.web import app
from rogue_scores.web.app import index, scores_upload, scores_json
class FakeR... | 30.638095 | 78 | 0.5788 | 2,843 | 0.883743 | 0 | 0 | 0 | 0 | 0 | 0 | 468 | 0.145477 |
8eb1436051dd71a0f14169c0a3e3c5db3f38a647 | 95 | py | Python | Bio-StrongHold/src/Partial_Permutations.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | 1 | 2018-10-10T19:03:52.000Z | 2018-10-10T19:03:52.000Z | Bio-StrongHold/src/Partial_Permutations.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | null | null | null | Bio-StrongHold/src/Partial_Permutations.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | null | null | null | from math import factorial
n = 86
k = 8
res = factorial(n)/factorial(n-k)%1e6
print int(res)
| 11.875 | 37 | 0.694737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8eb1ed9124daee9f997f42d027fa2279f05ec66b | 3,162 | py | Python | OwnVsRent/Investment.py | hermantai/beta-programs | 06dadc61845a55f15dba76f1438b6795d26d6820 | [
"Apache-2.0"
] | null | null | null | OwnVsRent/Investment.py | hermantai/beta-programs | 06dadc61845a55f15dba76f1438b6795d26d6820 | [
"Apache-2.0"
] | null | null | null | OwnVsRent/Investment.py | hermantai/beta-programs | 06dadc61845a55f15dba76f1438b6795d26d6820 | [
"Apache-2.0"
] | null | null | null | """
Investment
created by Herman Tai 3/20/2008
"""
from math import *
TOLERANCE = 0.0000001
def equals(n1,n2):
return abs(n1-n2) <TOLERANCE
def calculate_monthly_payment(principle,year,rate_percent):
terms = year * 12.0
rate = rate_percent/100.0
monthly_rate = rate/12.0
# special case
if mo... | 31.62 | 159 | 0.63852 | 1,619 | 0.512018 | 0 | 0 | 0 | 0 | 0 | 0 | 150 | 0.047438 |
8eb2a4b31e0e2b5fb4e1538f458c2107162096b7 | 1,544 | py | Python | Sakurajima/models/recommendation.py | TrimVis/Sakurajima | 9d3f6acc0a6228d94da58a518f7cfdd796d652f7 | [
"MIT"
] | null | null | null | Sakurajima/models/recommendation.py | TrimVis/Sakurajima | 9d3f6acc0a6228d94da58a518f7cfdd796d652f7 | [
"MIT"
] | null | null | null | Sakurajima/models/recommendation.py | TrimVis/Sakurajima | 9d3f6acc0a6228d94da58a518f7cfdd796d652f7 | [
"MIT"
] | null | null | null | import requests
import json
from Sakurajima.models import base_models as bm
class RecommendationEntry(object):
def __init__(self, data_dict, headers, cookies, api_url):
self.__headers = headers
self.__cookies = cookies
self.__API_URL = api_url
self.title = data_dict.get("title", No... | 35.090909 | 85 | 0.619171 | 1,465 | 0.948834 | 0 | 0 | 0 | 0 | 0 | 0 | 215 | 0.139249 |
8eb329a5034df522f053c63062da9cdf64fd7143 | 3,620 | py | Python | edinet_baseline_hourly_module/edinet_models/pyEMIS/EventDetection/event_model.py | BeeGroup-cimne/module_edinet | 0cda52e9d6222a681f85567e9bf0f7e5885ebf5e | [
"MIT"
] | null | null | null | edinet_baseline_hourly_module/edinet_models/pyEMIS/EventDetection/event_model.py | BeeGroup-cimne/module_edinet | 0cda52e9d6222a681f85567e9bf0f7e5885ebf5e | [
"MIT"
] | 13 | 2021-03-25T22:24:38.000Z | 2022-03-12T00:56:45.000Z | edinet_baseline_hourly_module/edinet_models/pyEMIS/EventDetection/event_model.py | BeeGroup-cimne/module_edinet | 0cda52e9d6222a681f85567e9bf0f7e5885ebf5e | [
"MIT"
] | 1 | 2019-03-13T09:49:56.000Z | 2019-03-13T09:49:56.000Z | """Events separate segements of data. A model is fitted to each segment independently"""
import numpy as np
class InvalidPeriod(Exception): pass
class event(object):
def __init__(self, date):
self.date = date
def period_range(min_date, max_date, events, index):
if index > len(events): raise InvalidPe... | 34.150943 | 110 | 0.625138 | 1,881 | 0.519613 | 0 | 0 | 0 | 0 | 0 | 0 | 570 | 0.157459 |
8eb3fe8d61ca018e169ea0f932496e2418d8f490 | 2,388 | py | Python | muscle_tuning/logisticregression_tuning.py | c60evaporator/param_tuning_utility | 8518b76369dcc918172a87ab4c975ee3a12f7045 | [
"BSD-3-Clause"
] | null | null | null | muscle_tuning/logisticregression_tuning.py | c60evaporator/param_tuning_utility | 8518b76369dcc918172a87ab4c975ee3a12f7045 | [
"BSD-3-Clause"
] | null | null | null | muscle_tuning/logisticregression_tuning.py | c60evaporator/param_tuning_utility | 8518b76369dcc918172a87ab4c975ee3a12f7045 | [
"BSD-3-Clause"
] | null | null | null | from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import numpy as np
from .param_tuning import ParamTuning
class LogisticRegressionTuning(ParamTuning):
"""
サポートベクター分類チューニング用クラス
"""
# 共通定数
SEED = 42 # デフォルト乱... | 32.27027 | 105 | 0.600503 | 2,967 | 0.937145 | 0 | 0 | 0 | 0 | 0 | 0 | 1,853 | 0.585281 |
8eb4e2799d377de7e9d39b8148f9aadd7b2d4071 | 1,578 | py | Python | main.py | Marques004/Medical-Data-Visualizer | 1c096cc3f7732b532b94a60021f102f15680f98c | [
"MIT"
] | null | null | null | main.py | Marques004/Medical-Data-Visualizer | 1c096cc3f7732b532b94a60021f102f15680f98c | [
"MIT"
] | null | null | null | main.py | Marques004/Medical-Data-Visualizer | 1c096cc3f7732b532b94a60021f102f15680f98c | [
"MIT"
] | null | null | null | import os
os.environ['MPLCONFIGDIR'] = os.getcwd() + "/configs/"
import matplotlib
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv('medical_examination.csv')
df['overweight'] = (df['weight'] / (df['height']/100)**2).apply(lambda x: 1 if x > 25 else 0)
df['... | 33.574468 | 144 | 0.627376 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 475 | 0.301014 |
8eb5d6396e2a31bb9fbff7585432ac8ecb96f4b0 | 2,785 | py | Python | Gadakeco_Code/src/gui/guiscrollbar.py | YueNing/gadakeco-ml | ec64703d7d6582d867b873f333b230d32b0e1d1a | [
"MIT"
] | 3 | 2019-07-26T15:47:23.000Z | 2019-10-02T13:39:49.000Z | Gadakeco_Code/src/gui/guiscrollbar.py | YueNing/gadakeco-ml | ec64703d7d6582d867b873f333b230d32b0e1d1a | [
"MIT"
] | 5 | 2019-07-26T20:32:50.000Z | 2019-07-26T20:48:34.000Z | Gadakeco_Code/src/gui/guiscrollbar.py | YueNing/gadakeco-neat | ec64703d7d6582d867b873f333b230d32b0e1d1a | [
"MIT"
] | 1 | 2019-07-28T21:51:19.000Z | 2019-07-28T21:51:19.000Z | import pygame
from gui.guielement import GuiElement
HORIZONTAL = 0
VERTICAL = 1
class GuiScrollbar(GuiElement):
"""
scrollbar / slider
"""
def __init__(self, x, y, width, height, fontObj, value=0.0, orientation=HORIZONTAL, barLength=30):
GuiElement.__init__(self, x, y, width, ... | 36.168831 | 117 | 0.549013 | 2,691 | 0.966248 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 0.012926 |
8eb61d8e3e5b97341a3cbfca6e4c058994f2fde4 | 1,785 | py | Python | sympy/physics/unitsystems/systems/natural.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | sympy/physics/unitsystems/systems/natural.py | curzel-it/KiPyCalc | 909c783d5e6967ea58ca93f875106d8a8e3ca5db | [
"MIT"
] | 7 | 2017-05-01T14:15:32.000Z | 2017-09-06T20:44:24.000Z | sympy/physics/unitsystems/systems/natural.py | curzel-it/KiPyCalc | 909c783d5e6967ea58ca93f875106d8a8e3ca5db | [
"MIT"
] | 3 | 2015-04-18T22:33:32.000Z | 2015-09-23T06:45:07.000Z | # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Naturalunit system.
The natural system comes from "setting c = 1, hbar = 1". From the computer
point of view it means that we use velocity and action instead of length and
time. Moreover instead of mass we use energy.
"""
from __future__ import division
from sympy... | 37.1875 | 76 | 0.712605 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 516 | 0.289076 |
8eb69037013653cb91aa261a3a91f12415a4923f | 816 | py | Python | airbnb/random_request.py | jaksmid/airbnb-python | 5fd049f683b0a3ad30bf34342927f50dd99c8b6d | [
"WTFPL"
] | 171 | 2015-01-03T09:51:38.000Z | 2022-03-20T18:56:09.000Z | airbnb/random_request.py | jaksmid/airbnb-python | 5fd049f683b0a3ad30bf34342927f50dd99c8b6d | [
"WTFPL"
] | 25 | 2015-03-30T03:55:26.000Z | 2022-03-19T23:28:34.000Z | airbnb/random_request.py | jaksmid/airbnb-python | 5fd049f683b0a3ad30bf34342927f50dd99c8b6d | [
"WTFPL"
] | 76 | 2015-03-28T02:23:03.000Z | 2022-03-19T23:27:42.000Z | import random
import uuid
import os
class RandomRequest(object):
@classmethod
def get_random_user_agent(cls):
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'files/supported_ios_versions.txt')) as f:
ios_versions = f.read().splitlines()
with open(os.path.join(... | 32.64 | 118 | 0.681373 | 777 | 0.952206 | 0 | 0 | 731 | 0.895833 | 0 | 0 | 113 | 0.13848 |
8eb74a5d4b26092fceaac2ec7a39970256c7a4c4 | 76 | py | Python | qrcode_styled/types.py | AdamBrianBright/qrcode_styled | da4c11934cca49b78ac688f5ff942352c7b58807 | [
"MIT"
] | 3 | 2021-08-03T15:55:08.000Z | 2021-12-13T03:23:18.000Z | qrcode_styled/types.py | AdamBrianBright/qrcode_styled | da4c11934cca49b78ac688f5ff942352c7b58807 | [
"MIT"
] | null | null | null | qrcode_styled/types.py | AdamBrianBright/qrcode_styled | da4c11934cca49b78ac688f5ff942352c7b58807 | [
"MIT"
] | null | null | null | from typing import Union
__all__ = [
'num',
]
num = Union[int, float]
| 9.5 | 24 | 0.618421 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0.065789 |
8eb7a596233dad4bd13e3f014ef38f1b7c4660a5 | 867 | py | Python | git_pylint/reporter.py | vcoder4c/git_pylint | 9e72e725152d59c1f94663c8ca1e841615a4b6cd | [
"MIT"
] | 1 | 2020-08-29T19:23:06.000Z | 2020-08-29T19:23:06.000Z | git_pylint/reporter.py | vcoder4c/git_pylint | 9e72e725152d59c1f94663c8ca1e841615a4b6cd | [
"MIT"
] | null | null | null | git_pylint/reporter.py | vcoder4c/git_pylint | 9e72e725152d59c1f94663c8ca1e841615a4b6cd | [
"MIT"
] | null | null | null | from pylint.reporters.json import JSONReporter
def json_reporter_handle_message(self, msg):
"""Manage message of different type and in the context of path."""
self.messages.append({
'path': msg.path,
'abspath': msg.abspath,
'line': msg.line,
'column': msg.column,
'modul... | 27.967742 | 73 | 0.600923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 197 | 0.22722 |
8eba32c6fbf4ca5fdda513dc3cc28ee4369367a4 | 12,492 | py | Python | partstem/__init__.py | AndreyPerelygin/partstem | dacd0537aa2ddf8ac85fd28fc337dd9f0e8235a4 | [
"Apache-2.0"
] | null | null | null | partstem/__init__.py | AndreyPerelygin/partstem | dacd0537aa2ddf8ac85fd28fc337dd9f0e8235a4 | [
"Apache-2.0"
] | null | null | null | partstem/__init__.py | AndreyPerelygin/partstem | dacd0537aa2ddf8ac85fd28fc337dd9f0e8235a4 | [
"Apache-2.0"
] | null | null | null | from nltk.stem import SnowballStemmer
from nltk.stem.api import StemmerI
import nltk
import json
class ParticleStemmer(SnowballStemmer):
def __init__(self, language="english", ignore_stopwords=False, suffix_rule_list={}):
super().__init__(language=language, ignore_stopwords=ignore_stopwords)
if language == "engl... | 35.896552 | 891 | 0.580692 | 12,362 | 0.989435 | 0 | 0 | 0 | 0 | 0 | 0 | 7,379 | 0.590603 |
8ebc8f2acab51140910ab8af9bec5bb0c1f48067 | 700 | py | Python | tests/test_utils.py | kairosfuture/abacusevents | 121215a6855f2e0371e557b5f0d1dd7f2f33e069 | [
"MIT"
] | null | null | null | tests/test_utils.py | kairosfuture/abacusevents | 121215a6855f2e0371e557b5f0d1dd7f2f33e069 | [
"MIT"
] | null | null | null | tests/test_utils.py | kairosfuture/abacusevents | 121215a6855f2e0371e557b5f0d1dd7f2f33e069 | [
"MIT"
] | null | null | null | import os
from abacusevents.utils import env, lowercase_first
def test_env_is_short_for_os_dot_environ():
os.environ['FOO'] = 'BAR'
assert env('FOO') == 'BAR'
def test_env_lets_you_specify_a_default_value():
default = env('NOT_THERE', 'FOO')
assert default == 'FOO'
def test_env_wont_explode():
... | 24.137931 | 51 | 0.665714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 86 | 0.122857 |
8ebd3cea58ee2b7b8500c146fbc4d43dc8ae98f8 | 6,340 | py | Python | analysis/Scripts/FunctionScript.py | data301-2021-summer2/group07-Project | 48e399c45cecbe2e596dbd214fa21b939f75e5ae | [
"MIT"
] | null | null | null | analysis/Scripts/FunctionScript.py | data301-2021-summer2/group07-Project | 48e399c45cecbe2e596dbd214fa21b939f75e5ae | [
"MIT"
] | 1 | 2021-08-06T11:01:27.000Z | 2021-08-16T05:20:02.000Z | analysis/Scripts/FunctionScript.py | data301-2021-summer2/group07-Project | 48e399c45cecbe2e596dbd214fa21b939f75e5ae | [
"MIT"
] | 2 | 2021-07-12T21:48:09.000Z | 2021-08-15T00:19:27.000Z | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
def LoadnClean (path):
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
df = (
pd.read_csv(path,index_col = 0)
)
df1 = ( df
.replace("",float("NaN"))
... | 43.129252 | 195 | 0.435016 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,216 | 0.349527 |
8ebed4d0176c34b024d1e9fb74490c28a812e120 | 305 | py | Python | application/__init__.py | DelgadGuilherme/labproghiper-microblog | 5acfdfcd1b6f731dca53b6649422d07683038ea4 | [
"Apache-2.0"
] | null | null | null | application/__init__.py | DelgadGuilherme/labproghiper-microblog | 5acfdfcd1b6f731dca53b6649422d07683038ea4 | [
"Apache-2.0"
] | null | null | null | application/__init__.py | DelgadGuilherme/labproghiper-microblog | 5acfdfcd1b6f731dca53b6649422d07683038ea4 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
import os
templates_folder = os.path.abspath("application/view/templates")
static_folder = os.path.abspath("application/view/static")
app = Flask(__name__,template_folder=templates_folder,static_folder=static_folder)
from application.controller import hello_controller | 30.5 | 83 | 0.813115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.17377 |
8ebf0f9b2161bc522983927efdf52e3e727f1b40 | 664 | py | Python | _projects/new.py | devChuk/ddevchuk.github.io | 1bb83b27f887158b532186af38b3fd5851bdc01b | [
"MIT"
] | 2 | 2017-03-12T07:45:15.000Z | 2017-07-17T02:36:01.000Z | _projects/new.py | devChuk/ddevchuk.github.io | 1bb83b27f887158b532186af38b3fd5851bdc01b | [
"MIT"
] | 1 | 2015-03-20T03:30:47.000Z | 2015-03-23T03:49:47.000Z | _projects/new.py | devChuk/ddevchuk.github.io | 1bb83b27f887158b532186af38b3fd5851bdc01b | [
"MIT"
] | 1 | 2015-06-14T23:06:55.000Z | 2015-06-14T23:06:55.000Z | #Just a simple script to automate the YAML front matter in new posts
import datetime
import os
title = raw_input('\nEnter title: ')
fileName= title.replace(" ", "_").lower() + '.md'
print fileName + '\n'
text = """---
layout: project
title: {}
date: Feb 2015
thumbnail: http://devchuk.github.io/devchukV1/res/img/porti... | 21.419355 | 77 | 0.721386 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 455 | 0.685241 |
8ec13621ede7ad08cdf4a9c2edd5a1f939fb4fac | 1,820 | py | Python | AI_Web/GA/tools/pre_load_data.py | xwy27/ArtificialIntelligenceProjects | e2b0154f07d749084e2d670260fa82f8f5ea23ed | [
"MIT"
] | 4 | 2018-12-19T14:10:56.000Z | 2021-07-12T06:05:17.000Z | AI_Web/GA/tools/pre_load_data.py | xwy27/ArtificialIntelligenceProjects | e2b0154f07d749084e2d670260fa82f8f5ea23ed | [
"MIT"
] | 1 | 2019-08-06T01:57:41.000Z | 2019-08-06T01:57:41.000Z | AI_Web/SA/tools/pre_load_data.py | xwy27/ArtificialIntelligenceProjects | e2b0154f07d749084e2d670260fa82f8f5ea23ed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''pre load default TSP city data into database'''
from django.db.transaction import atomic
from ..models import *
import os
@atomic
def atomic_save(items):
for item in items:
item.save()
# Load default city data
def load_cities(cities_folder_path, delete=False):
'''
Load data fi... | 26.764706 | 64 | 0.562088 | 0 | 0 | 0 | 0 | 68 | 0.037322 | 0 | 0 | 540 | 0.296378 |
8ec186c4e3adffdeaef95f08452042f97de330e2 | 11,725 | py | Python | saasy_boi/apis.py | NetskopeOSS/sassy_boi | dbbfd9223a8a93e495ea39c0e8ea54be5fb47715 | [
"BSD-3-Clause"
] | 6 | 2019-10-09T03:51:34.000Z | 2022-01-08T19:59:07.000Z | saasy_boi/apis.py | NetskopeOSS/sassy_boi | dbbfd9223a8a93e495ea39c0e8ea54be5fb47715 | [
"BSD-3-Clause"
] | null | null | null | saasy_boi/apis.py | NetskopeOSS/sassy_boi | dbbfd9223a8a93e495ea39c0e8ea54be5fb47715 | [
"BSD-3-Clause"
] | 1 | 2021-08-05T07:25:06.000Z | 2021-08-05T07:25:06.000Z | # Copyright 2019 Netskope, Inc.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. ... | 27.916667 | 120 | 0.615778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,408 | 0.375949 |
8ec19cdfebcf6eb13a2b18ea13fafc46252266f9 | 413 | py | Python | testguess/templates/testguess/json.py | kezabelle/django-testguess | 0d33fd3291157f6454e74e47944767de5dc8a91c | [
"BSD-2-Clause"
] | null | null | null | testguess/templates/testguess/json.py | kezabelle/django-testguess | 0d33fd3291157f6454e74e47944767de5dc8a91c | [
"BSD-2-Clause"
] | null | null | null | testguess/templates/testguess/json.py | kezabelle/django-testguess | 0d33fd3291157f6454e74e47944767de5dc8a91c | [
"BSD-2-Clause"
] | null | null | null | def test_response_is_json(self):
from json import loads
response = self.client.{{ request.method|lower }}('{{ request.path }}', data={{ request.data|safe }})
self.assertFalse(response.streaming)
# rather than F, this will E
content = loads(response.content)
expected =... | 41.3 | 109 | 0.631961 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 90 | 0.217918 |
8ec1e9523ebc0bba611e68e3f95d01d207d019c2 | 308 | py | Python | database_program.py | amintai/Hacktoberfest-1 | ccfe3688db720e35e032eaf7c7dfcaf86bc94272 | [
"MIT"
] | null | null | null | database_program.py | amintai/Hacktoberfest-1 | ccfe3688db720e35e032eaf7c7dfcaf86bc94272 | [
"MIT"
] | null | null | null | database_program.py | amintai/Hacktoberfest-1 | ccfe3688db720e35e032eaf7c7dfcaf86bc94272 | [
"MIT"
] | null | null | null | import mysql.connector
mydb = mysql.connector.connect(
host="databaseurl",
user="username",
password="password",
database="database_name",
)
mycursor = mydb.cursor()
code = input("Enter SQL code here ")
sql = code
mycursor.execute(sql)
mydb.commit()
print(mycursor.rowcount, "record inserted.")
| 16.210526 | 44 | 0.720779 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.285714 |
8ec330c45c5450e56db86bcc225b4e9c85a36af2 | 941 | py | Python | codeforces/B/8-451B.py | safiulanik/problem-solving | 116539750b901b55fe6e69447c8ede78f2e9ff16 | [
"MIT"
] | null | null | null | codeforces/B/8-451B.py | safiulanik/problem-solving | 116539750b901b55fe6e69447c8ede78f2e9ff16 | [
"MIT"
] | null | null | null | codeforces/B/8-451B.py | safiulanik/problem-solving | 116539750b901b55fe6e69447c8ede78f2e9ff16 | [
"MIT"
] | null | null | null | """
URL: https://codeforces.com/problemset/problem/451/B
Author: Safiul Kabir [safiulanik at gmail.com]
Tags: implementation, sortings, *1300
"""
def main():
n = int(input())
ll = list(map(int, input().split()))
start, end = -1, -1
for i in range(n - 1):
if ll[i] > ll[i + 1]:
sta... | 20.021277 | 74 | 0.430393 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 184 | 0.195537 |
8ec5846ccf710a39df521d57cab6d18b4a25c956 | 68 | py | Python | pywren_ibm_cloud/storage/backends/ibm_cos/__init__.py | gerardparis/pywren-ibm-cloud | ca69bed54f5bd5157bcda961b86dbfcfecf3c54a | [
"Apache-2.0"
] | 158 | 2020-09-16T13:22:03.000Z | 2022-03-28T20:01:31.000Z | pywren_ibm_cloud/storage/backends/ibm_cos/__init__.py | gerardparis/pywren-ibm-cloud | ca69bed54f5bd5157bcda961b86dbfcfecf3c54a | [
"Apache-2.0"
] | 256 | 2018-05-20T13:01:51.000Z | 2020-09-16T09:09:54.000Z | pywren_ibm_cloud/storage/backends/ibm_cos/__init__.py | gerardparis/pywren-ibm-cloud | ca69bed54f5bd5157bcda961b86dbfcfecf3c54a | [
"Apache-2.0"
] | 48 | 2020-09-19T15:29:53.000Z | 2022-03-23T17:08:24.000Z | from .ibm_cos import IBMCloudObjectStorageBackend as StorageBackend
| 34 | 67 | 0.897059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ec5c30f23ba531d5364376457bcfc23d7f65b85 | 2,877 | py | Python | finetune-data-sampling/pytorch_softmax_regression_4_class.py | lankuohsing/machine-learning-in-python | a7317325dd914402231ee908e4208e1ddb171a28 | [
"MIT"
] | null | null | null | finetune-data-sampling/pytorch_softmax_regression_4_class.py | lankuohsing/machine-learning-in-python | a7317325dd914402231ee908e4208e1ddb171a28 | [
"MIT"
] | null | null | null | finetune-data-sampling/pytorch_softmax_regression_4_class.py | lankuohsing/machine-learning-in-python | a7317325dd914402231ee908e4208e1ddb171a28 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 7 22:03:24 2021
@author: lankuohsing
"""
import numpy as np
import torch.utils.data as Data
import torch
from collections import OrderedDict
from torchsummary import summary
# In[]
data1=[]
labels1=[]
data2=[]
labels2=[]
with open("./dataset/4_class_data_2d.txt",'r',enc... | 33.453488 | 186 | 0.668752 | 297 | 0.101817 | 0 | 0 | 0 | 0 | 0 | 0 | 533 | 0.182722 |
8ec7abf3f5da5952254f519ad7b912d9d04dbca3 | 7,476 | py | Python | app/py/database.py | tbor8080/pyhongo | 11d200509913f80399c758197d215ff0ff6049cd | [
"MIT"
] | null | null | null | app/py/database.py | tbor8080/pyhongo | 11d200509913f80399c758197d215ff0ff6049cd | [
"MIT"
] | null | null | null | app/py/database.py | tbor8080/pyhongo | 11d200509913f80399c758197d215ff0ff6049cd | [
"MIT"
] | null | null | null | # /usr/bin/env python
# -*- coding: utf-8 -*-
def ErrorMessage(modulename=None):
print(f'Import Can\'t Module "{modulename}"')
print('Read the .md file')
print('pip -r requirements.txt')
import inspect,sqlite3
# load module
from py.sheet.sheet import *
try:
# PostgreSQL
import psycopg2
except Mo... | 23.28972 | 108 | 0.563537 | 6,844 | 0.915096 | 0 | 0 | 0 | 0 | 0 | 0 | 1,616 | 0.216072 |
8ec8117705a6e00290140c42310bd866602c4857 | 6,543 | py | Python | Training.py | Waewarin-C/MLProject | 9bd3821db24b1210621169cbbfdd68a1d6e6ab20 | [
"CC-BY-4.0"
] | null | null | null | Training.py | Waewarin-C/MLProject | 9bd3821db24b1210621169cbbfdd68a1d6e6ab20 | [
"CC-BY-4.0"
] | null | null | null | Training.py | Waewarin-C/MLProject | 9bd3821db24b1210621169cbbfdd68a1d6e6ab20 | [
"CC-BY-4.0"
] | null | null | null | from TabularTrainer import *
from RandomPlayer import *
from TicTacToe import *
import matplotlib.pyplot as plt
action_to_coordinate = {0: (0, 0), 1: (0, 1), 2: (0, 2),
3: (1, 0), 4: (1, 1), 5: (1, 2),
6: (2, 0), 7: (2, 1), 8: (2, 2)}
NUM_OF_BATTLES = 10
NUM_OF_GAMES = ... | 34.436842 | 107 | 0.561058 | 6,116 | 0.934739 | 0 | 0 | 0 | 0 | 0 | 0 | 706 | 0.107902 |
8ec9af37320f3317b87c57c752336e62fe5c3973 | 3,402 | py | Python | util/visualize3d.py | jshuhnow/OddEyeCam | ed76cd1c29701b7b49f20bcd61e7e72d3140fda8 | [
"MIT"
] | 8 | 2020-10-08T13:32:33.000Z | 2021-12-08T10:59:03.000Z | util/visualize3d.py | jshuhnow/OddEyeCam | ed76cd1c29701b7b49f20bcd61e7e72d3140fda8 | [
"MIT"
] | null | null | null | util/visualize3d.py | jshuhnow/OddEyeCam | ed76cd1c29701b7b49f20bcd61e7e72d3140fda8 | [
"MIT"
] | 1 | 2021-04-15T23:50:13.000Z | 2021-04-15T23:50:13.000Z | import os
import sys
from core.math_tool.coordinate_system import CoordSys
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import cv2
def _update_element(obj,data,is_Point=False):
if is_Point:
obj.set_data(data[0], data[1])
obj.set_3d_properties(data[2], z... | 43.063291 | 129 | 0.592593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 198 | 0.058201 |
8ecb338cf3968f1e2415034f8610eb76602e4a7a | 7,134 | py | Python | spell/keyboardspell.py | leolca/spellcheck | 1edf7a598052822d0f95885288a3cf7f6d706c84 | [
"MIT"
] | null | null | null | spell/keyboardspell.py | leolca/spellcheck | 1edf7a598052822d0f95885288a3cf7f6d706c84 | [
"MIT"
] | null | null | null | spell/keyboardspell.py | leolca/spellcheck | 1edf7a598052822d0f95885288a3cf7f6d706c84 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .utils import exists, nlargest, removeMultiple
from .spell import Spell
class KeyboardSpell(Spell):
def __init__(self, spelldic=None, corpusfile=None, suffixfile=None, language=None, encoding=None, keyboardlayoutfile=None, weightObjFun=None):
# call the parent constructor
... | 45.43949 | 174 | 0.585506 | 7,030 | 0.985422 | 0 | 0 | 443 | 0.062097 | 0 | 0 | 2,744 | 0.384637 |
8ecc375f9b2ef579824f623a0c86a56a39d05d4d | 2,262 | py | Python | src/helpTool/imFilterPipeline.py | uguisu/DraftTensorflow_chinese_hand_writing | 13f4097dff53ff32d10d51789975700e18052500 | [
"Apache-2.0"
] | null | null | null | src/helpTool/imFilterPipeline.py | uguisu/DraftTensorflow_chinese_hand_writing | 13f4097dff53ff32d10d51789975700e18052500 | [
"Apache-2.0"
] | 1 | 2018-01-25T06:39:52.000Z | 2018-01-25T13:37:44.000Z | src/helpTool/imFilterPipeline.py | uguisu/DraftTensorflow_chinese_hand_writing | 13f4097dff53ff32d10d51789975700e18052500 | [
"Apache-2.0"
] | 1 | 2018-04-22T13:55:18.000Z | 2018-04-22T13:55:18.000Z | # encoding: UTF-8
import cv2
import numpy as np
class ImFilterPipeline:
def __init__(self):
# init pipeline
self._pipeline = {
"rotated": 0,
"blur": 0,
"gaussianBlur": 0,
"resize": 0
}
@property
def pipeline(self):
return s... | 29.763158 | 103 | 0.564987 | 2,209 | 0.976569 | 0 | 0 | 63 | 0.027851 | 0 | 0 | 706 | 0.312113 |
8ece7d53acacbd74d22fdfc3c2e28686c0f3e1f0 | 2,052 | py | Python | tests/karura_test/test_database_api.py | ScoopML-labs/karura | ffd3d06e496ffbb0602d3cff3ac0692c747523ab | [
"Apache-2.0"
] | 74 | 2017-03-03T00:35:14.000Z | 2021-12-26T17:50:48.000Z | tests/karura_test/test_database_api.py | ScoopML-labs/karura | ffd3d06e496ffbb0602d3cff3ac0692c747523ab | [
"Apache-2.0"
] | 1 | 2017-08-18T02:50:11.000Z | 2017-08-18T07:15:25.000Z | tests/karura_test/test_database_api.py | ScoopML-labs/karura | ffd3d06e496ffbb0602d3cff3ac0692c747523ab | [
"Apache-2.0"
] | 6 | 2017-09-29T06:56:31.000Z | 2020-12-17T14:39:59.000Z | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
import unittest
from karura.database_api import DatabaseAPI
class TestDatabaseAPI(unittest.TestCase):
DBNAME = "test_database_uri"
API = None
@classmethod
def setUpClass(cls):
cls.API = DatabaseAPI(alterna... | 38.716981 | 97 | 0.661793 | 1,844 | 0.898635 | 0 | 0 | 234 | 0.114035 | 0 | 0 | 228 | 0.111111 |
8ece994dd1b163e2074ce6aebf451a06d9516101 | 310 | py | Python | python/time.py | LifengWang/ReportGen | 9266acc7cde7f21206a509607fef0676a8dab52e | [
"Apache-2.0"
] | null | null | null | python/time.py | LifengWang/ReportGen | 9266acc7cde7f21206a509607fef0676a8dab52e | [
"Apache-2.0"
] | 1 | 2020-10-14T01:01:12.000Z | 2020-10-14T01:01:12.000Z | python/time.py | LifengWang/ReportGen | 9266acc7cde7f21206a509607fef0676a8dab52e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import pandas as pd
import sys
def main():
# fle_path = '/home/alex/workspace/ReportGen/python/BigBenchTimes.csv'
file_path = sys.argv[1]
df = pd.read_csv(file_path, sep=';')
df.to_excel("BigBenchTimes.xlsx")
print df.to_string()
if __name__ == '__main__':
main()
| 19.375 | 74 | 0.664516 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 120 | 0.387097 |
8ecef356f844a42e3d374691a1124f1ea40fd4a1 | 1,225 | py | Python | etc/metadataParsers/includes/nameparser-0.2.3/setup.py | organisciak/HTRC-BookwormDB | bc24080d6443f8da38255e19149431c9e5b182ab | [
"MIT"
] | null | null | null | etc/metadataParsers/includes/nameparser-0.2.3/setup.py | organisciak/HTRC-BookwormDB | bc24080d6443f8da38255e19149431c9e5b182ab | [
"MIT"
] | null | null | null | etc/metadataParsers/includes/nameparser-0.2.3/setup.py | organisciak/HTRC-BookwormDB | bc24080d6443f8da38255e19149431c9e5b182ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import nameparser
import os
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
README = read('README.rst')
setup(name='nameparser',
packages = ['nameparser'... | 35 | 105 | 0.629388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 511 | 0.417143 |
8ecf4e191c51888fe96cf70ed22b287feafa153f | 300 | py | Python | SVM_example.py | COSC-Research-BowieState/ARP_Simulator | ec109253bc3cc6903252f6f24b1205b8e7bab189 | [
"MIT"
] | null | null | null | SVM_example.py | COSC-Research-BowieState/ARP_Simulator | ec109253bc3cc6903252f6f24b1205b8e7bab189 | [
"MIT"
] | null | null | null | SVM_example.py | COSC-Research-BowieState/ARP_Simulator | ec109253bc3cc6903252f6f24b1205b8e7bab189 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 4 17:41:56 2018
@author: hubert kyeremateng-boateng
"""
import numpy as np
import pandas as pd
recipes = pd.read_csv('arp_dataset.csv', header=None)
recipes.rename(columns={0: 'name'}, inplace=True)
print(np.transpose(recipes)) | 23.076923 | 53 | 0.71 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.493333 |
8ed11d23c76018ac70846f21efa7b622a426700a | 973 | py | Python | DiceRoll.py | SwethaGudla/Dice_POC | 818b343773027791508b59badf7159b1fee5f2f8 | [
"BSD-3-Clause"
] | null | null | null | DiceRoll.py | SwethaGudla/Dice_POC | 818b343773027791508b59badf7159b1fee5f2f8 | [
"BSD-3-Clause"
] | null | null | null | DiceRoll.py | SwethaGudla/Dice_POC | 818b343773027791508b59badf7159b1fee5f2f8 | [
"BSD-3-Clause"
] | null | null | null | import roll_dice as r #importing RollDice module
COUNT = 0 #initializing count
while True:
roll = input("Enter your choice(d/u/l/r): ").lower() #Pick your choice
if roll == 'down' or roll == 'd':
r.dice_down(r.res)
COUNT+=1
elif roll == 'up'or roll =='u':
... | 27.027778 | 75 | 0.51593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 332 | 0.341213 |
8ed19150ff78b6ca1c2491ef7203c5ad4bd6be6e | 2,756 | py | Python | app/updateinformation.py | mjogodnik22/mini-amazon | cc7caf9366b862e43271305d1b2d27bb6c08260d | [
"MIT"
] | null | null | null | app/updateinformation.py | mjogodnik22/mini-amazon | cc7caf9366b862e43271305d1b2d27bb6c08260d | [
"MIT"
] | null | null | null | app/updateinformation.py | mjogodnik22/mini-amazon | cc7caf9366b862e43271305d1b2d27bb6c08260d | [
"MIT"
] | null | null | null | from flask import render_template, redirect, url_for, flash, request
from werkzeug.urls import url_parse
from flask_login import login_user, logout_user, current_user
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, DecimalField, BooleanField, SelectField, SubmitField
from wtforms.validat... | 47.517241 | 199 | 0.675617 | 457 | 0.16582 | 0 | 0 | 1,575 | 0.57148 | 0 | 0 | 520 | 0.188679 |
8ed3c961a32f648b6ecbf986b24a8369b72e355c | 457 | py | Python | 05_data_science/matplotlib/bar_chart.py | bluehenry/python.best.practices | 99fde3557b0c423d3050e988e82a641ccd75b644 | [
"MIT"
] | null | null | null | 05_data_science/matplotlib/bar_chart.py | bluehenry/python.best.practices | 99fde3557b0c423d3050e988e82a641ccd75b644 | [
"MIT"
] | null | null | null | 05_data_science/matplotlib/bar_chart.py | bluehenry/python.best.practices | 99fde3557b0c423d3050e988e82a641ccd75b644 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
divisions = ['Admin', 'Development', 'Lead', 'HR']
salary = [10, 14,20, 12]
age = [28, 30, 45, 32]
index = np.arange(4)
width = 0.3
plt.bar(index, salary, width, color='green', label='Salary')
plt.bar(index+width, age, width, color='blue', label='Age')
plt.title('Di... | 22.85 | 60 | 0.684902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 102 | 0.223195 |
8ed58557b8e3435731641f5c05374ed0db710745 | 1,951 | py | Python | python/clima.py | crato-thaissa/crato-thaissa.github.Io | 91d18e38461bdd202f0262abace65595fa1efa96 | [
"MIT"
] | null | null | null | python/clima.py | crato-thaissa/crato-thaissa.github.Io | 91d18e38461bdd202f0262abace65595fa1efa96 | [
"MIT"
] | null | null | null | python/clima.py | crato-thaissa/crato-thaissa.github.Io | 91d18e38461bdd202f0262abace65595fa1efa96 | [
"MIT"
] | null | null | null |
from string import *
import json, sys
from urllib.request import urlopen
#parameters
params1 = "<||^{tss+^=r]^/\A/+|</`[+^r]`;s.+|+s#r&sA/+|</`y_w"
params2 = ':#%:%!,"'
params3 = "-#%&!&')&:-/$,)+-.!:-::-"
params4 = params2 + params3
params_id = "j+^^=.w"
unit = [ "k", "atm"]
data1 = printable
data2 = punctuation... | 29.119403 | 108 | 0.603793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 686 | 0.351075 |
8ed69e0440b6aec85c5fa9e138215b592e9adcb1 | 2,309 | py | Python | src/main/python/apache/thermos/bin/thermos_ckpt.py | zmanji/incubator-aurora | 9f594f1de6bbf46c74863dd3fc4d2708b7a974f2 | [
"Apache-2.0"
] | null | null | null | src/main/python/apache/thermos/bin/thermos_ckpt.py | zmanji/incubator-aurora | 9f594f1de6bbf46c74863dd3fc4d2708b7a974f2 | [
"Apache-2.0"
] | null | null | null | src/main/python/apache/thermos/bin/thermos_ckpt.py | zmanji/incubator-aurora | 9f594f1de6bbf46c74863dd3fc4d2708b7a974f2 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | 27.488095 | 84 | 0.695972 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 899 | 0.389346 |
8ed6cda7ad637a16bcaea267f7b03c869ea08e8b | 1,913 | py | Python | test/lib/testFixed.py | animator/titus2 | 1d35fab2950bd9f0438b931a02996475271a695e | [
"Apache-2.0"
] | 18 | 2019-11-29T08:53:58.000Z | 2021-11-19T05:33:33.000Z | test/lib/testFixed.py | animator/titus2 | 1d35fab2950bd9f0438b931a02996475271a695e | [
"Apache-2.0"
] | 2 | 2020-04-29T12:58:32.000Z | 2021-03-23T05:55:43.000Z | test/lib/testFixed.py | animator/titus2 | 1d35fab2950bd9f0438b931a02996475271a695e | [
"Apache-2.0"
] | 1 | 2020-05-05T15:10:27.000Z | 2020-05-05T15:10:27.000Z | #!/usr/bin/env python
# Copyright (C) 2014 Open Data ("Open Data" refers to
# one or more of the following companies: Open Data Partners LLC,
# Open Data Research LLC, or Open Data Capital LLC.)
#
# This file is part of Hadrian.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | 37.509804 | 142 | 0.652901 | 1,041 | 0.544171 | 0 | 0 | 0 | 0 | 0 | 0 | 1,067 | 0.557763 |
8ed740f84eb596b331c579907df179ccc0238174 | 1,414 | py | Python | src/ai/backend/client/cli/main.py | youngjun0627/backend.ai-client-py | be7c174ab73e112fdb8be61e6affc20fc72f7d59 | [
"MIT"
] | 7 | 2019-01-18T08:08:42.000Z | 2022-02-10T00:36:24.000Z | src/ai/backend/client/cli/main.py | youngjun0627/backend.ai-client-py | be7c174ab73e112fdb8be61e6affc20fc72f7d59 | [
"MIT"
] | 179 | 2017-09-07T04:54:44.000Z | 2022-03-29T11:30:47.000Z | src/ai/backend/client/cli/main.py | youngjun0627/backend.ai-client-py | be7c174ab73e112fdb8be61e6affc20fc72f7d59 | [
"MIT"
] | 13 | 2017-09-08T05:37:44.000Z | 2021-09-14T23:35:31.000Z | import warnings
import click
from ai.backend.cli.extensions import ExtendedCommandGroup
from ai.backend.client import __version__
from ai.backend.client.output import get_output_handler
from ai.backend.client.config import APIConfig, set_config
from ai.backend.client.cli.types import CLIContext, OutputMode
@click.g... | 30.73913 | 84 | 0.712871 | 0 | 0 | 0 | 0 | 1,101 | 0.778642 | 0 | 0 | 243 | 0.171853 |
8eda6227d1c508e3c3dc40e3141ee055d68cff84 | 4,849 | py | Python | src/main/python/cybercaptain/processing/country.py | FHNW-CyberCaptain/CyberCaptain | 07c989190e997353fbf57eb7a386947d6ab8ffd5 | [
"MIT"
] | 1 | 2018-10-01T10:59:55.000Z | 2018-10-01T10:59:55.000Z | src/main/python/cybercaptain/processing/country.py | FHNW-CyberCaptain/CyberCaptain | 07c989190e997353fbf57eb7a386947d6ab8ffd5 | [
"MIT"
] | null | null | null | src/main/python/cybercaptain/processing/country.py | FHNW-CyberCaptain/CyberCaptain | 07c989190e997353fbf57eb7a386947d6ab8ffd5 | [
"MIT"
] | 1 | 2021-11-01T00:09:00.000Z | 2021-11-01T00:09:00.000Z | """
The country module contains the processing_country class.
"""
from os import path
import geoip2.database
from cybercaptain.utils.exceptions import ValidationError
from cybercaptain.processing.base import processing_base
from cybercaptain.utils.jsonFileHandler import json_file_reader, json_file_writer
class process... | 45.745283 | 193 | 0.647556 | 4,542 | 0.936688 | 0 | 0 | 0 | 0 | 0 | 0 | 2,443 | 0.503815 |
8edd3cd8565c24d7a33ad76b1b5ec1f65dc9407d | 473 | py | Python | attendees/whereabouts/migrations/0009_attendee_address_m2m.py | xjlin0/attendees | 3c337ee68c00f17cbbbe26f2e33131e57850e4ed | [
"MIT"
] | 1 | 2020-03-26T00:42:04.000Z | 2020-03-26T00:42:04.000Z | attendees/whereabouts/migrations/0009_attendee_address_m2m.py | xjlin0/attendees | 3c337ee68c00f17cbbbe26f2e33131e57850e4ed | [
"MIT"
] | null | null | null | attendees/whereabouts/migrations/0009_attendee_address_m2m.py | xjlin0/attendees | 3c337ee68c00f17cbbbe26f2e33131e57850e4ed | [
"MIT"
] | null | null | null | # Generated by Django 3.0.2 on 2020-01-21 06:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('persons', '0010_attendee_address'),
('whereabouts', '0008_room'),
]
operations = [
migrations.AddField(
model_name='addr... | 23.65 | 99 | 0.615222 | 380 | 0.803383 | 0 | 0 | 0 | 0 | 0 | 0 | 166 | 0.350951 |
8ede460bd8fcc02049fe028261dea40e63202e0a | 1,411 | py | Python | contents/2020_ITinerary/assets/session_1/car.py | EunSeong-Park/ITinerary | 7e33613e3382f3e4b4404ad6795bc28823c7641d | [
"MIT"
] | 4 | 2020-03-31T01:18:43.000Z | 2020-11-21T16:53:02.000Z | contents/2020_ITinerary/assets/session_1/car.py | EunSeong-Park/ITinerary | 7e33613e3382f3e4b4404ad6795bc28823c7641d | [
"MIT"
] | null | null | null | contents/2020_ITinerary/assets/session_1/car.py | EunSeong-Park/ITinerary | 7e33613e3382f3e4b4404ad6795bc28823c7641d | [
"MIT"
] | null | null | null | # skeleton
class Car:
def __init__(self, name, mileage, max_fuel):
self.name = name
self.mileage = mileage
self.max_fuel = max_fuel
self.fuel = self.max_fuel
self.dist = 0
def status(self):
''' Show the current status of the car
it should be called after brrr() and gas_statation()
... | 26.12963 | 81 | 0.582566 | 1,298 | 0.919915 | 0 | 0 | 0 | 0 | 0 | 0 | 646 | 0.457831 |
8edeb880bd3ced5f319652f9f1bebc920f8b9270 | 1,855 | py | Python | main.py | webgjc/web-touch-pad | a9270bfde10ffb9dc490a793a1264751c3eed52e | [
"MIT"
] | 10 | 2021-07-01T08:26:56.000Z | 2021-11-05T05:20:29.000Z | main.py | webgjc/web-touch-pad | a9270bfde10ffb9dc490a793a1264751c3eed52e | [
"MIT"
] | null | null | null | main.py | webgjc/web-touch-pad | a9270bfde10ffb9dc490a793a1264751c3eed52e | [
"MIT"
] | 2 | 2021-07-09T09:10:24.000Z | 2021-07-29T05:32:34.000Z | import socket
import pynput
from gevent import pywsgi
from flask_sockets import Sockets
from flask import Flask, request, render_template
from geventwebsocket.handler import WebSocketHandler
app = Flask(__name__)
sockets = Sockets(app)
mouse = pynput.mouse.Controller()
@app.route("/", methods=['GET', 'POST'])
def i... | 27.686567 | 86 | 0.607547 | 0 | 0 | 0 | 0 | 1,103 | 0.567679 | 0 | 0 | 428 | 0.220278 |
8edf5aa5e27f7a23873c95f6b823d38d6d75b822 | 2,652 | py | Python | dmsp/io.py | space-physics/digital-meridian-spectrometer | 8b46ad53c99a6340f28067fa5c3ee3c877cfcbf2 | [
"Apache-2.0"
] | null | null | null | dmsp/io.py | space-physics/digital-meridian-spectrometer | 8b46ad53c99a6340f28067fa5c3ee3c877cfcbf2 | [
"Apache-2.0"
] | null | null | null | dmsp/io.py | space-physics/digital-meridian-spectrometer | 8b46ad53c99a6340f28067fa5c3ee3c877cfcbf2 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Tuple
from netCDF4 import Dataset
import xarray
import numpy as np
from datetime import datetime, timedelta
from dateutil.parser import parse
def load(
fn: Path, tlim: Tuple[datetime, datetime] = None, elevlim: Tuple[float, float] = None
) -> xarray.Dataset:
"""
... | 37.352113 | 90 | 0.565988 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 845 | 0.318627 |
8ee1d299cf6ec687ec90359acd199e326a83c21f | 1,402 | py | Python | mergify_engine/config.py | bowlofeggs/mergify-engine | 463811a15835c1439fe75e3168113aa497892c77 | [
"Apache-2.0"
] | null | null | null | mergify_engine/config.py | bowlofeggs/mergify-engine | 463811a15835c1439fe75e3168113aa497892c77 | [
"Apache-2.0"
] | null | null | null | mergify_engine/config.py | bowlofeggs/mergify-engine | 463811a15835c1439fe75e3168113aa497892c77 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.155556 | 75 | 0.607703 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 898 | 0.640057 |
8ee287666b52dd443104856eb3949c8aa83d480b | 2,735 | py | Python | bin/log_csv.py | scitran/nimsapi | a4203cf6c6d29aa15d33011250ee69ff929fcb0d | [
"MIT"
] | 13 | 2016-05-31T14:32:58.000Z | 2021-09-17T07:18:11.000Z | bin/log_csv.py | scitran/core | a4203cf6c6d29aa15d33011250ee69ff929fcb0d | [
"MIT"
] | 911 | 2016-02-16T18:40:27.000Z | 2018-08-07T17:50:29.000Z | bin/log_csv.py | scitran/nimsapi | a4203cf6c6d29aa15d33011250ee69ff929fcb0d | [
"MIT"
] | 16 | 2016-02-17T15:54:34.000Z | 2021-04-07T05:30:34.000Z | # This implementation as of July 19 2017 has these resource utilizations of the mongodb container:
# - 2 million entries: 1.50 Gb
# - 3 million entries: 2.05 Gb
# The entire docker application was given 6 Gb to use, when given the default 2 Gb,
# the process would frequently crash before 1 million entries were down... | 32.951807 | 98 | 0.614991 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 822 | 0.300548 |
8ee3cd2f187e49e671286db1a81ac32e75328dea | 3,740 | py | Python | planemo/database/postgres.py | pvanheus/planemo | 12c4256325bb1b274dcd40d64b91c1f832cf49b1 | [
"CC-BY-3.0"
] | 73 | 2015-01-03T15:09:26.000Z | 2022-03-30T23:52:55.000Z | planemo/database/postgres.py | pvanheus/planemo | 12c4256325bb1b274dcd40d64b91c1f832cf49b1 | [
"CC-BY-3.0"
] | 958 | 2015-01-02T08:27:45.000Z | 2022-03-23T14:51:51.000Z | planemo/database/postgres.py | jmchilton/planemo | d352a085fe10cb6b7c1384663b114201da42d97b | [
"CC-BY-3.0"
] | 84 | 2015-01-06T18:27:28.000Z | 2021-11-18T01:58:17.000Z | """Module describes a :class:`DatabaseSource` for local postgres databases."""
import subprocess
from galaxy.util import unicodify
from planemo.io import communicate
from .interface import DatabaseSource
class ExecutesPostgresSqlMixin:
def list_databases(self):
"""Use `psql --list` to generate a list ... | 34.953271 | 85 | 0.655615 | 3,473 | 0.92861 | 0 | 0 | 0 | 0 | 0 | 0 | 946 | 0.252941 |
8ee5290b246e0f20240930080e650291b2ae9065 | 2,029 | py | Python | tests/test_mdnsCallbackHandler.py | pkeroulas/nmos-common | b650bad276819d794624f4ff6ea08fbdecd915d7 | [
"Apache-2.0"
] | 7 | 2017-12-08T08:05:51.000Z | 2020-10-21T07:32:42.000Z | tests/test_mdnsCallbackHandler.py | pkeroulas/nmos-common | b650bad276819d794624f4ff6ea08fbdecd915d7 | [
"Apache-2.0"
] | 63 | 2017-12-13T08:46:58.000Z | 2020-12-02T08:48:40.000Z | tests/test_mdnsCallbackHandler.py | pkeroulas/nmos-common | b650bad276819d794624f4ff6ea08fbdecd915d7 | [
"Apache-2.0"
] | 7 | 2017-11-22T10:49:23.000Z | 2022-03-15T22:00:17.000Z | #!/usr/bin/env python
# Copyright 2017 British Broadcasting Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 28.985714 | 80 | 0.656481 | 1,232 | 0.607196 | 0 | 0 | 0 | 0 | 0 | 0 | 713 | 0.351405 |
8ee6449defa3c3d44a2b59e09354dc78f44affea | 882 | py | Python | src/posts/views.py | wmtamit/IceBook-Django | 4625f6ae879c64be9d71d10eca111b837f2fe8bc | [
"MIT"
] | null | null | null | src/posts/views.py | wmtamit/IceBook-Django | 4625f6ae879c64be9d71d10eca111b837f2fe8bc | [
"MIT"
] | null | null | null | src/posts/views.py | wmtamit/IceBook-Django | 4625f6ae879c64be9d71d10eca111b837f2fe8bc | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .models import Post
from .forms import PostForm
@login_required
def add_post_view(request):
if request.method == "POST":
form = PostForm(request.POST, request.FILES)
if form.is_valid():
obj = form.save(commit=Fa... | 23.837838 | 57 | 0.741497 | 0 | 0 | 0 | 0 | 352 | 0.399093 | 0 | 0 | 96 | 0.108844 |
8ee86c19092798935cd7b241e9fbac234703710d | 14,019 | py | Python | cvpro/Utils.py | Mohak-CODING-HEAVEN/CVPRO | 09a2cb4a428738c9e77f17b71469d55eff5e3699 | [
"MIT"
] | 5 | 2021-07-24T18:20:11.000Z | 2022-03-23T09:58:27.000Z | cvpro/Utils.py | Mohak-CODING-HEAVEN/cvpro | 09a2cb4a428738c9e77f17b71469d55eff5e3699 | [
"MIT"
] | null | null | null | cvpro/Utils.py | Mohak-CODING-HEAVEN/cvpro | 09a2cb4a428738c9e77f17b71469d55eff5e3699 | [
"MIT"
] | null | null | null | """
Utilities - CVPRO
BY: MOHAK BAJAJ
CODING HEAVEN
"""
import math
import time
import logging
import cv2
import numpy as np
import copy
def stackImages(_imgList, cols, scale):
"""
Stack Images together to display in a single window
:param _imgList: list of images to stack
:param co... | 35.491139 | 105 | 0.527855 | 7,518 | 0.536272 | 0 | 0 | 0 | 0 | 0 | 0 | 3,778 | 0.269491 |
8eeb463cad3d2986fa543d29cd235afba9ffb070 | 3,664 | py | Python | elstruct/reader/gaussian/freq.py | avcopan/elstruct-interface | 593929b5cf975e2f455125e446f8ca6a12482e5d | [
"Apache-2.0"
] | null | null | null | elstruct/reader/gaussian/freq.py | avcopan/elstruct-interface | 593929b5cf975e2f455125e446f8ca6a12482e5d | [
"Apache-2.0"
] | null | null | null | elstruct/reader/gaussian/freq.py | avcopan/elstruct-interface | 593929b5cf975e2f455125e446f8ca6a12482e5d | [
"Apache-2.0"
] | 1 | 2018-11-16T20:44:31.000Z | 2018-11-16T20:44:31.000Z | """
Library of functions to retrieve frequency information from a Gaussian 09e output file.
Frequencies currently supported:
(1) Harmonic Vibrational Frequencies
(2) Harmonic Zero-Point Vibrational Energy
"""
__authors__ = "Kevin Moore, Andreas Copan"
__updated__ = "2019-01-15"
from ..rere import parse as repar
fro... | 28.403101 | 87 | 0.622544 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,131 | 0.581605 |
8eed14fe9df66636359b69e6afcb70db03dc49df | 7,460 | py | Python | main.py | andrewlavaia/Traffic-Simulator | 39c21e94ff3026954f1577a8f9e70c6d605cb286 | [
"MIT"
] | null | null | null | main.py | andrewlavaia/Traffic-Simulator | 39c21e94ff3026954f1577a8f9e70c6d605cb286 | [
"MIT"
] | null | null | null | main.py | andrewlavaia/Traffic-Simulator | 39c21e94ff3026954f1577a8f9e70c6d605cb286 | [
"MIT"
] | null | null | null | import time
import sys
from graphics import GraphApp, GraphWin, Text, Point, _root
from menu import MainMenu
from graphs import Graph, ShortestPaths
from maps import RoadMap
from cars import Car, CarShape, CarFactory
from gps import GPS
from info_window import InfoWindow, RoadInfoWindow
from collision import GridColli... | 33.452915 | 104 | 0.640617 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 997 | 0.133646 |
8eed562bb3ffb90d5a64ae9eed83f174c8c31c52 | 11,116 | py | Python | util/modules_asym.py | Isaac-Li-cn/certify_robustness | f904dc923afc6354e406c57a1c923d13fc39d315 | [
"BSD-3-Clause"
] | null | null | null | util/modules_asym.py | Isaac-Li-cn/certify_robustness | f904dc923afc6354e406c57a1c923d13fc39d315 | [
"BSD-3-Clause"
] | null | null | null | util/modules_asym.py | Isaac-Li-cn/certify_robustness | f904dc923afc6354e406c57a1c923d13fc39d315 | [
"BSD-3-Clause"
] | null | null | null | """
这个文件修改自原文件,修改内容包括:
1. 删除quadratic algorithm的使用,因为还没想好该怎么用
2. 从原来的单扰动改为多扰动
"""
'''
>>> This file creates modules that can do forward, backward pass as well as bound propagation
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from abc import ABCMeta, ab... | 35.066246 | 154 | 0.609662 | 10,564 | 0.942541 | 0 | 0 | 895 | 0.079854 | 0 | 0 | 6,081 | 0.542559 |
8eed7af0e7e14fb232a58b34bca05351e370155d | 1,050 | py | Python | lambda-encoding/lambda_codec/__main__.py | aroberge/import-experiments | 3ceeab9f2443a259f0a1cbd3cd8e09bff7856178 | [
"MIT"
] | null | null | null | lambda-encoding/lambda_codec/__main__.py | aroberge/import-experiments | 3ceeab9f2443a259f0a1cbd3cd8e09bff7856178 | [
"MIT"
] | null | null | null | lambda-encoding/lambda_codec/__main__.py | aroberge/import-experiments | 3ceeab9f2443a259f0a1cbd3cd8e09bff7856178 | [
"MIT"
] | null | null | null | """
main.py
----------
"""
import argparse
import os
import runpy
import sys
from . import console
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description="Description",
)
parser.add_argument(
"source",
nargs="?",
help="""Name of the script to be run a... | 22.826087 | 81 | 0.639048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 245 | 0.233333 |
8eeec43ac2ba36819f5ca566f6976a86baf0f967 | 4,779 | py | Python | apetools/connections/localconnection.py | rsnakamura/oldape | b4d1c77e1d611fe2b30768b42bdc7493afb0ea95 | [
"Apache-2.0"
] | null | null | null | apetools/connections/localconnection.py | rsnakamura/oldape | b4d1c77e1d611fe2b30768b42bdc7493afb0ea95 | [
"Apache-2.0"
] | null | null | null | apetools/connections/localconnection.py | rsnakamura/oldape | b4d1c77e1d611fe2b30768b42bdc7493afb0ea95 | [
"Apache-2.0"
] | null | null | null |
#python Libraries
from StringIO import StringIO
from collections import namedtuple
import Queue
import os
# Third-party Libraries
try:
import pexpect
except ImportError as error:
#print error
pass
# apetools Libraries
from apetools.baseclass import BaseClass
from apetools.commons.errors import Connection... | 28.446429 | 101 | 0.6018 | 3,634 | 0.76041 | 0 | 0 | 214 | 0.044779 | 0 | 0 | 1,674 | 0.350282 |
8eef37709e19ecce787c089fc77ca3d1055e5516 | 5,167 | py | Python | nex2art/core/Nexus.py | IntershopCommunicationsAG/nexus2artifactory | 233bad5e9a0992c64892f16202b1e61df12852d9 | [
"Apache-2.0"
] | null | null | null | nex2art/core/Nexus.py | IntershopCommunicationsAG/nexus2artifactory | 233bad5e9a0992c64892f16202b1e61df12852d9 | [
"Apache-2.0"
] | null | null | null | nex2art/core/Nexus.py | IntershopCommunicationsAG/nexus2artifactory | 233bad5e9a0992c64892f16202b1e61df12852d9 | [
"Apache-2.0"
] | null | null | null | import os
import logging
import xml.etree.ElementTree as ET
from . import Security, Ldap
class Nexus:
def __init__(self):
self.log = logging.getLogger(__name__)
self.path = None
self.repos = None
self.repomap = None
self.dirty = True
self.ldap = Ldap()
self.s... | 41.336 | 79 | 0.543255 | 5,076 | 0.982388 | 0 | 0 | 0 | 0 | 0 | 0 | 1,159 | 0.224308 |
8eefe1977906d53f705ef27c60547b06a9610720 | 2,523 | py | Python | memory_game/memory_game.py | Jimut123/code_skulptor_pygames | 1bb2c65f5bc5519f3caed956a6f5a55a7359fcb3 | [
"MIT"
] | 2 | 2018-11-17T21:12:16.000Z | 2018-12-06T15:04:27.000Z | memory_game/memory_game.py | Jimut123/code_skulptor_pygames | 1bb2c65f5bc5519f3caed956a6f5a55a7359fcb3 | [
"MIT"
] | null | null | null | memory_game/memory_game.py | Jimut123/code_skulptor_pygames | 1bb2c65f5bc5519f3caed956a6f5a55a7359fcb3 | [
"MIT"
] | null | null | null | # implementation of card game - Memory
import simplegui
import random
# for repeatition check
# helper function to initialize globals
def new_game():
cards1 = range(0,8)
cards2 = range(0,8)
random.shuffle(cards1)
random.shuffle(cards2)
global cardDeck
cardDeck = cards1 + cards2
random.shu... | 30.39759 | 133 | 0.575109 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 602 | 0.238605 |
8ef3b330ea6a710b3d536345a2cc24ce60527a6a | 2,547 | py | Python | python/periodic-web-scrapper/scraper/utilities/WebUtilities.py | MarioCodes/ProyectosClaseDAM | df568b4feda8bf3a6cf7cc8e81e7dfa4156dcfd9 | [
"Apache-2.0"
] | null | null | null | python/periodic-web-scrapper/scraper/utilities/WebUtilities.py | MarioCodes/ProyectosClaseDAM | df568b4feda8bf3a6cf7cc8e81e7dfa4156dcfd9 | [
"Apache-2.0"
] | 17 | 2019-06-14T12:30:46.000Z | 2022-02-18T11:38:50.000Z | python/periodic-web-scrapper/scraper/utilities/WebUtilities.py | MarioCodes/ProyectosClaseDAM | df568b4feda8bf3a6cf7cc8e81e7dfa4156dcfd9 | [
"Apache-2.0"
] | null | null | null | '''
Created on Mar 22, 2018
@author: msanchez
'''
import requests
from html.parser import HTMLParser
import urllib
class WebUtilities(object):
def __init__(self):
''' Utility class. Has everything that has to do with web download / requests.
It may also create static HTML web pages.
... | 33.513158 | 108 | 0.568512 | 2,430 | 0.953689 | 0 | 0 | 0 | 0 | 0 | 0 | 1,586 | 0.622449 |
d6feb2821863a29b4221e191fc8923133c2fe913 | 2,585 | py | Python | shepherd/sheep/base_sheep.py | iterait/shepherd | 0847c9885584378dd68a48c40d03f9bb02b2b57c | [
"MIT"
] | 5 | 2018-10-13T19:03:07.000Z | 2019-02-25T06:44:27.000Z | shepherd/sheep/base_sheep.py | iterait/shepherd | 0847c9885584378dd68a48c40d03f9bb02b2b57c | [
"MIT"
] | 62 | 2018-09-13T08:03:39.000Z | 2022-01-03T09:05:54.000Z | shepherd/sheep/base_sheep.py | iterait/shepherd | 0847c9885584378dd68a48c40d03f9bb02b2b57c | [
"MIT"
] | null | null | null | import abc
import logging
from typing import List, Optional
from asyncio import Queue
import zmq.asyncio
from zmq.error import ZMQBaseError
from schematics import Model
from schematics.types import StringType, IntType, ListType
class BaseSheep(metaclass=abc.ABCMeta):
"""
A base class for container adapters -... | 37.463768 | 117 | 0.667311 | 2,353 | 0.910251 | 0 | 0 | 148 | 0.057253 | 0 | 0 | 960 | 0.371373 |
d9011b28c63281bc996099c09c306b728df0ffa9 | 1,546 | py | Python | test5.py | fr0zn/solquery | c3b1989fa887c9cc09ea091bf9bf36793fdd73a4 | [
"MIT"
] | null | null | null | test5.py | fr0zn/solquery | c3b1989fa887c9cc09ea091bf9bf36793fdd73a4 | [
"MIT"
] | null | null | null | test5.py | fr0zn/solquery | c3b1989fa887c9cc09ea091bf9bf36793fdd73a4 | [
"MIT"
] | null | null | null |
class MetaVarList(list):
def __new__(cls, data=None, formatter=None):
cls._formatter = formatter
obj = super(MetaVarList, cls).__new__(cls, data)
return obj
def __str__(self):
return 'myList(%s)' % list(self)
def __format__(self, spec):
print(spec)
#... | 24.539683 | 112 | 0.600906 | 1,116 | 0.721863 | 0 | 0 | 0 | 0 | 0 | 0 | 171 | 0.110608 |
d90152eceb846416a3fc96e372d419d89b8f7cbd | 4,462 | py | Python | theano/sandbox/mkl/tests/gen_conv_graph.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 64 | 2016-10-02T20:41:56.000Z | 2020-03-11T14:59:40.000Z | theano/sandbox/mkl/tests/gen_conv_graph.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 4 | 2017-06-12T05:12:38.000Z | 2018-03-15T03:16:30.000Z | theano/sandbox/mkl/tests/gen_conv_graph.py | intel/Theano-dev | 6ca6fd4646f9e958058c7bce52cd51923c05c2f4 | [
"BSD-3-Clause"
] | 30 | 2016-10-27T21:59:00.000Z | 2021-02-20T09:55:14.000Z | import theano
import unittest
import numpy
from nose.plugins.skip import SkipTest
from theano import tensor as T
from theano.tensor.nnet import conv2d
from theano.sandbox import mkl
numpy.random.seed(123)
if not mkl.mkl_available:
raise SkipTest('Optional package MKL disabled')
if theano.config.mode == 'FAST_COM... | 48.5 | 119 | 0.722098 | 3,760 | 0.842671 | 0 | 0 | 0 | 0 | 0 | 0 | 545 | 0.122143 |
d9022f601f4293f1035df02426253ad8f56ff9ca | 12,142 | py | Python | tests/test_views.py | lavyaKoli/stormpath-flask | ca79162302e34085bef774751288d2ac95479c0d | [
"Apache-2.0"
] | 99 | 2015-01-04T06:27:10.000Z | 2021-07-27T11:06:15.000Z | tests/test_views.py | lavyaKoli/stormpath-flask | ca79162302e34085bef774751288d2ac95479c0d | [
"Apache-2.0"
] | 65 | 2015-01-05T17:34:27.000Z | 2019-01-21T09:59:01.000Z | tests/test_views.py | lavyaKoli/stormpath-flask | ca79162302e34085bef774751288d2ac95479c0d | [
"Apache-2.0"
] | 37 | 2015-03-20T16:24:44.000Z | 2020-10-01T16:12:30.000Z | """Run tests against our custom views."""
from flask.ext.stormpath.models import User
from .helpers import StormpathTestCase
class TestRegister(StormpathTestCase):
"""Test our registration view."""
def test_default_fields(self):
# By default, we'll register new users with first name, last name,
... | 38.18239 | 125 | 0.558887 | 12,005 | 0.988717 | 0 | 0 | 0 | 0 | 0 | 0 | 4,375 | 0.36032 |
d902b516a40dcba0794e54939272a83437efbea7 | 1,097 | py | Python | operators.py | Javip142/astr-119 | 018bcc1518d35d9a5ecc81b39343dce53325fa5b | [
"MIT"
] | null | null | null | operators.py | Javip142/astr-119 | 018bcc1518d35d9a5ecc81b39343dce53325fa5b | [
"MIT"
] | 6 | 2021-09-29T22:16:39.000Z | 2021-12-09T10:44:50.000Z | operators.py | Javip142/astr-119 | 018bcc1518d35d9a5ecc81b39343dce53325fa5b | [
"MIT"
] | null | null | null | x = 9
y = 3
# Arithmetic Operators
print(x+y) #addtion
print(x-y) #subtraction
print(x*y) #multiplication
print(x/y) #division
print(x%y) #modulus provides remainder after we do long divison
print(x**y) #Exponentiation
x = 9.191823
print("Floor divide:", x//y) #Floor divison, how many times does a nu... | 29.648649 | 88 | 0.583409 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 693 | 0.631723 |
d903529b12c98aca3ff5d6845a7f6381cda45ac6 | 404 | py | Python | controlpanel/controlpanel/ros_check/models.py | filesmuggler/acc_web_server | 2497cbfdb08db30d4eb1ca842cee7c2f65ff7470 | [
"MIT"
] | null | null | null | controlpanel/controlpanel/ros_check/models.py | filesmuggler/acc_web_server | 2497cbfdb08db30d4eb1ca842cee7c2f65ff7470 | [
"MIT"
] | null | null | null | controlpanel/controlpanel/ros_check/models.py | filesmuggler/acc_web_server | 2497cbfdb08db30d4eb1ca842cee7c2f65ff7470 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Car(models.Model):
car_name = models.CharField(max_length=50)
car_hostname = models.CharField(max_length=50)
car_state = models.CharField(max_length=50)
def __str__(self):
return self.car_name
def get_hostname(self):
... | 22.444444 | 50 | 0.695545 | 346 | 0.856436 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.064356 |
d9040f536e5e7d98863330b02abf8e1540d41786 | 7,340 | py | Python | demo/trace.py | nicolasCruzW21/maskrcnn-Tracing | da648eb09f7034faa7b29a48543d777d05968d82 | [
"MIT"
] | 3 | 2020-06-10T04:37:01.000Z | 2021-12-20T07:45:48.000Z | demo/trace.py | nicolasCruzW21/maskrcnn-Tracing | da648eb09f7034faa7b29a48543d777d05968d82 | [
"MIT"
] | 1 | 2020-06-17T09:05:31.000Z | 2021-09-13T09:16:36.000Z | demo/trace.py | nicolasCruzW21/maskrcnn-Tracing | da648eb09f7034faa7b29a48543d777d05968d82 | [
"MIT"
] | 1 | 2020-07-06T05:47:12.000Z | 2020-07-06T05:47:12.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import argparse
import cv2
from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
import torch
import time
from PIL import Image
import numpy
from matplotlib import pyplot
def combine_masks_tuple(input_model):
# type: (Tuple[... | 38.229167 | 178 | 0.639646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,514 | 0.206267 |
d904aa2e2fa43b92a5d3dd1e133389c9c177bb50 | 8,736 | py | Python | app/dell_racadm_info_update.py | haoaaren/check_dell_racadm | cf5aa09fc60b42426811e90cb3812279d3d167a8 | [
"MIT"
] | 4 | 2019-11-20T08:02:00.000Z | 2021-01-05T04:36:59.000Z | app/dell_racadm_info_update.py | haoaaren/check_dell_racadm | cf5aa09fc60b42426811e90cb3812279d3d167a8 | [
"MIT"
] | null | null | null | app/dell_racadm_info_update.py | haoaaren/check_dell_racadm | cf5aa09fc60b42426811e90cb3812279d3d167a8 | [
"MIT"
] | 1 | 2021-01-05T04:37:02.000Z | 2021-01-05T04:37:02.000Z | #coding:utf-8
from flask import request,render_template, redirect,session
from . import app
from dbutil import DB
from collections import OrderedDict
import json
import datetime
# 基础
from dell_racadm import check_client_ip,check_dell_racadm_ip,dell_racadm_achieve_ip_info,achieve_dell_cacadm_comman,check_dell_racadm_in... | 41.799043 | 138 | 0.704556 | 0 | 0 | 0 | 0 | 7,712 | 0.793416 | 0 | 0 | 2,621 | 0.26965 |
d904b9c8e847f19331cc7dff09301eaaa05f6fd5 | 5,275 | py | Python | src/config.py | tfhkzp/telegram_follow_trader | ea32ba63d230d7244967d57a1cb8ade608e2761a | [
"MIT"
] | 1 | 2020-12-17T16:51:27.000Z | 2020-12-17T16:51:27.000Z | src/config.py | tfhkzp/telegram_follow_trader | ea32ba63d230d7244967d57a1cb8ade608e2761a | [
"MIT"
] | null | null | null | src/config.py | tfhkzp/telegram_follow_trader | ea32ba63d230d7244967d57a1cb8ade608e2761a | [
"MIT"
] | null | null | null | import os
from configparser import RawConfigParser
import constants
import utils
class Config(RawConfigParser):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.disclaimer_section_header = "disclaimer"
self.telegram_section_header = "telegram"
self.teleg... | 39.074074 | 112 | 0.630711 | 5,191 | 0.984076 | 0 | 0 | 0 | 0 | 0 | 0 | 993 | 0.188246 |
d907a43938650d8d6f9175971c2ee412f0e1b223 | 1,430 | py | Python | Problems/primetest.py | NielsonJ/Project-Euler | d54dce5461825c440a094310c3567b88c6f9a150 | [
"MIT"
] | null | null | null | Problems/primetest.py | NielsonJ/Project-Euler | d54dce5461825c440a094310c3567b88c6f9a150 | [
"MIT"
] | 1 | 2020-03-11T08:06:25.000Z | 2020-03-11T08:06:34.000Z | Problems/primetest.py | NielsonJ/Project-Euler | d54dce5461825c440a094310c3567b88c6f9a150 | [
"MIT"
] | null | null | null | from libs.primelib import Prime
import cProfile
import time
# Test variable's
primeindex = 100000
primecheck = 1000000000000
def main():
prime = Prime()
print('test 1:')
start = time.clock()
value = prime.getByIndex(primeindex)
end = time.clock()
print('value: ' + str(value))
print('time:... | 21.666667 | 43 | 0.58042 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 183 | 0.127972 |
d908ab4f59b016aac181ee4e124679993f2e35d0 | 1,579 | py | Python | 05_open_sensor_data/scripts/worker.py | Vourhey/robonomics_tutorials | 3dd7ad5db9037f0c681b93ebe1fdfca46ef9761d | [
"BSD-3-Clause"
] | 1 | 2020-02-10T17:27:46.000Z | 2020-02-10T17:27:46.000Z | 05_open_sensor_data/scripts/worker.py | Vourhey/robonomics_tutorials | 3dd7ad5db9037f0c681b93ebe1fdfca46ef9761d | [
"BSD-3-Clause"
] | null | null | null | 05_open_sensor_data/scripts/worker.py | Vourhey/robonomics_tutorials | 3dd7ad5db9037f0c681b93ebe1fdfca46ef9761d | [
"BSD-3-Clause"
] | 1 | 2020-04-30T06:48:26.000Z | 2020-04-30T06:48:26.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ROS
import rospy
from std_msgs.msg import String
# Robonomics communication
from robonomics_msgs.msg import Demand, Result
from ipfs_common.msg import Multihash
from ipfs_common.ipfs_rosbag import IpfsRosBag
class WorkerNode:
def __init__(self):
rospy.ini... | 26.762712 | 111 | 0.624446 | 1,265 | 0.80114 | 0 | 0 | 0 | 0 | 0 | 0 | 337 | 0.213426 |
d90aaafe7f9c1c206b79ec748e75d1bc2e4fe249 | 14,009 | py | Python | dubplate/tests/test_dubplate.py | GreenBuildingRegistry/dubplate | 5bb11abfd17c557a7be63acfb1ede7834ea17b88 | [
"MIT"
] | 1 | 2018-04-20T08:33:40.000Z | 2018-04-20T08:33:40.000Z | dubplate/tests/test_dubplate.py | GreenBuildingRegistry/dubplate | 5bb11abfd17c557a7be63acfb1ede7834ea17b88 | [
"MIT"
] | null | null | null | dubplate/tests/test_dubplate.py | GreenBuildingRegistry/dubplate | 5bb11abfd17c557a7be63acfb1ede7834ea17b88 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
copyright (c) 2016-2017 Earth Advantage. All rights reserved.
..codeauthor::Paul Munday <paul@paulmunday.net>
Unit tests for dubplate.
"""
# Imports from Standard Library
import datetime
import json
import sys
import six
import unittest
# Imports from Third Party Modules
fr... | 31.551802 | 78 | 0.585766 | 13,423 | 0.95817 | 0 | 0 | 1,190 | 0.084945 | 0 | 0 | 3,566 | 0.254551 |
d90b2d6635c836ba8cc887d96866eaefa439a024 | 1,582 | py | Python | gui.py | quintenroets/gui | d53461771f847805be533d96dcceb4f10f9ec9d7 | [
"MIT"
] | null | null | null | gui.py | quintenroets/gui | d53461771f847805be533d96dcceb4f10f9ec9d7 | [
"MIT"
] | null | null | null | gui.py | quintenroets/gui | d53461771f847805be533d96dcceb4f10f9ec9d7 | [
"MIT"
] | null | null | null | import subprocess
import cli
def ask(message, choices=None, options=None):
options = {"text": f"<big>{message}</big>"} | (options or {})
if choices is None:
res = run("entry", options=options)
res = res and res.strip()
elif isinstance(choices, list):
res = ask_choices(choices, op... | 29.296296 | 79 | 0.606195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 337 | 0.213021 |
d90d9c04b806e6d86ef86148bed6c3ca773c27ce | 7,425 | py | Python | Models.py | PatrickgHayes/gmm-dnn-for-interpretability | 83f88a5df726fbf4eacc68a679232e24c0d7b0f3 | [
"MIT"
] | null | null | null | Models.py | PatrickgHayes/gmm-dnn-for-interpretability | 83f88a5df726fbf4eacc68a679232e24c0d7b0f3 | [
"MIT"
] | null | null | null | Models.py | PatrickgHayes/gmm-dnn-for-interpretability | 83f88a5df726fbf4eacc68a679232e24c0d7b0f3 | [
"MIT"
] | null | null | null | # DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
#
# This material is based upon work supported by the Assistant Secretary of Defense for Research and
# Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions,
# findings, conclusions or recommendat... | 34.534884 | 100 | 0.654545 | 2,847 | 0.383383 | 0 | 0 | 0 | 0 | 0 | 0 | 3,245 | 0.436978 |
d90dd4f090fbbdcff512c7f61334e4e5095d8c05 | 354 | py | Python | src/Discord/command/admin/shutdown.py | JulesWall/Discord-py-bot-base | 6d89d74b5e6e0a603f171c791f96bb33ecbb41e8 | [
"MIT"
] | null | null | null | src/Discord/command/admin/shutdown.py | JulesWall/Discord-py-bot-base | 6d89d74b5e6e0a603f171c791f96bb33ecbb41e8 | [
"MIT"
] | null | null | null | src/Discord/command/admin/shutdown.py | JulesWall/Discord-py-bot-base | 6d89d74b5e6e0a603f171c791f96bb33ecbb41e8 | [
"MIT"
] | null | null | null | import discord
from config import *
class ShutDown:
def __init__(self,message : discord.Message, bot : discord.Client()):
self.bot = bot
self.message = message
async def run(self):
if self.message.author.id in OWNER:
await self.message.channel.send('Shut down')
... | 29.5 | 73 | 0.612994 | 317 | 0.89548 | 0 | 0 | 0 | 0 | 160 | 0.451977 | 11 | 0.031073 |
d90e7322e3f76de768fce6699f8d10d828183ad2 | 2,018 | py | Python | utensor_cgen/api/utils.py | uTensor/utensor_cgen | eccd6859028d0b6a350dced25ea72ff02faaf9ad | [
"Apache-2.0"
] | 49 | 2018-01-06T12:57:56.000Z | 2021-09-03T09:48:32.000Z | utensor_cgen/api/utils.py | uTensor/utensor_cgen | eccd6859028d0b6a350dced25ea72ff02faaf9ad | [
"Apache-2.0"
] | 101 | 2018-01-16T19:24:21.000Z | 2021-11-10T19:39:33.000Z | utensor_cgen/api/utils.py | uTensor/utensor_cgen | eccd6859028d0b6a350dced25ea72ff02faaf9ad | [
"Apache-2.0"
] | 32 | 2018-02-15T19:39:50.000Z | 2020-11-26T22:32:05.000Z | import textwrap
import click
def show_ugraph(ugraph, oneline=False, ignore_unknown_op=False):
from utensor_cgen.backend.utensor.code_generator.legacy._operators import OperatorFactory
unknown_ops = set([])
if oneline:
tmpl = click.style("{op_name} ", fg='yellow', bold=True) + \
"op_type: {op_type}, ... | 33.633333 | 91 | 0.648167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 344 | 0.170466 |
d90ed500716a103d48309e19afcddb7e4867f4c9 | 1,396 | py | Python | boards/emu/board.py | evezor/Edge_Boards | 7d0e0858c235982e6f62ce97db6a86e1759241a0 | [
"MIT"
] | 2 | 2020-12-03T06:26:48.000Z | 2022-01-30T22:00:22.000Z | boards/emu/board.py | evezor/Edge_Boards | 7d0e0858c235982e6f62ce97db6a86e1759241a0 | [
"MIT"
] | 4 | 2020-08-23T21:21:30.000Z | 2021-04-02T01:05:48.000Z | boards/emu/board.py | evezor/Edge_Boards | 7d0e0858c235982e6f62ce97db6a86e1759241a0 | [
"MIT"
] | 2 | 2020-08-20T16:38:17.000Z | 2020-08-28T02:07:31.000Z | # board.py
# abstract class for zorg and edge
import time
from ocan import *
class Board():
can_id = None
pause = True
ocan = None
def __init__(self, manifest):
self.manifest = manifest
self.ocan = OCan()
self.init_board()
self.init_filters()
self.boot()
... | 23.266667 | 64 | 0.553725 | 1,314 | 0.941261 | 0 | 0 | 0 | 0 | 0 | 0 | 348 | 0.249284 |
d90f3304a9f8b119e26ad00862e02c94d7978328 | 962 | py | Python | bin/rtmg_complete.py | linsalrob/bioinformatics | da250531fdc3b0e5d6be0ac44d7874fa201f92b0 | [
"MIT"
] | null | null | null | bin/rtmg_complete.py | linsalrob/bioinformatics | da250531fdc3b0e5d6be0ac44d7874fa201f92b0 | [
"MIT"
] | null | null | null | bin/rtmg_complete.py | linsalrob/bioinformatics | da250531fdc3b0e5d6be0ac44d7874fa201f92b0 | [
"MIT"
] | 1 | 2020-03-07T07:15:51.000Z | 2020-03-07T07:15:51.000Z |
import rob
import sys
# 1404927386.fasta analyzed_sequences.txt annotations.txt
#
faf=None
try:
faf=sys.argv[1]
except IndexError:
sys.stderr.write("Please provide a fasta file\n")
sys.exit(0)
fa = rob.readFasta(faf)
analyzed=[]
with open('analyzed_sequences.txt', 'r') as asf:
for line in asf... | 20.468085 | 91 | 0.60395 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 262 | 0.272349 |
d9102c896bee462a9b81d732607e83c597abdf5a | 1,403 | py | Python | examples/lstm/elmo_embeddings/torchtext/predict.py | yngtodd/scene | 99355c05b1668586fa09ac70b39c258b39e73c72 | [
"MIT"
] | 2 | 2019-04-18T18:06:41.000Z | 2021-03-09T02:05:34.000Z | examples/lstm/elmo_embeddings/torchtext/predict.py | yngtodd/scene | 99355c05b1668586fa09ac70b39c258b39e73c72 | [
"MIT"
] | null | null | null | examples/lstm/elmo_embeddings/torchtext/predict.py | yngtodd/scene | 99355c05b1668586fa09ac70b39c258b39e73c72 | [
"MIT"
] | null | null | null | import os
import tqdm
import torch
import numpy as np
from parser import parse_args
from scene.data import DataSet
from torchtext.data import Iterator
from scene.data.loaders import BatchWrapper
from scene.models import BiLSTM
def predict(model, loader):
model.eval()
predictions = []
for data in tqdm.... | 24.189655 | 66 | 0.685674 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.054882 |
d91267f7c1e50773407fdc19adb815e69ec5e2f9 | 423 | py | Python | LeetCode/python3/929.py | ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | [
"MIT"
] | 279 | 2019-02-19T16:00:32.000Z | 2022-03-23T12:16:30.000Z | LeetCode/python3/929.py | ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | [
"MIT"
] | 2 | 2019-03-31T08:03:06.000Z | 2021-03-07T04:54:32.000Z | LeetCode/python3/929.py | ZintrulCre/LeetCode_Crawler | de23e16ead29336b5ee7aa1898a392a5d6463d27 | [
"MIT"
] | 12 | 2019-01-29T11:45:32.000Z | 2019-02-04T16:31:46.000Z | class Solution:
def numUniqueEmails(self, emails):
"""
:type emails: List[str]
:rtype: int
"""
email_set = set()
for email in emails:
local, domain = email.split('@')
local = local.replace('.', '')
if '+' in local:
l... | 30.214286 | 48 | 0.477541 | 423 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.191489 |
d9130637f37aa67dccc5076d10b6043a6f6dd312 | 9,926 | py | Python | test/test_random_tester.py | shanefeng123/agilkia | 0ac4e9dd29f9ab0026037f71d7f28d017e54949b | [
"MIT"
] | 3 | 2020-02-11T14:22:51.000Z | 2020-11-26T19:09:03.000Z | test/test_random_tester.py | shanefeng123/agilkia | 0ac4e9dd29f9ab0026037f71d7f28d017e54949b | [
"MIT"
] | 1 | 2019-11-22T02:06:47.000Z | 2021-05-10T07:22:26.000Z | test/test_random_tester.py | shanefeng123/agilkia | 0ac4e9dd29f9ab0026037f71d7f28d017e54949b | [
"MIT"
] | 4 | 2019-12-12T10:44:07.000Z | 2022-03-10T14:09:27.000Z | # -*- coding: utf-8 -*-
"""
Unit tests for the RandomTester class.
@author: m.utting@uq.edu.au
"""
import unittest
import random
from pathlib import Path
import sklearn.utils.estimator_checks
from typing import Tuple, List, Set, Dict, Optional, Any
import agilkia
THIS_DIR = Path(__file__).parent
WSDL_EG = "http://... | 42.969697 | 107 | 0.590872 | 9,331 | 0.940056 | 0 | 0 | 0 | 0 | 0 | 0 | 1,963 | 0.197763 |
d914350d04727b2996e71856ecd3f13d1e827077 | 2,576 | py | Python | cratertools/utils/salamuniccar.py | utplanets/cratertools | 3cd303f5e598d9945e186924b3e25af1457d3749 | [
"MIT"
] | null | null | null | cratertools/utils/salamuniccar.py | utplanets/cratertools | 3cd303f5e598d9945e186924b3e25af1457d3749 | [
"MIT"
] | null | null | null | cratertools/utils/salamuniccar.py | utplanets/cratertools | 3cd303f5e598d9945e186924b3e25af1457d3749 | [
"MIT"
] | null | null | null | # extract the Salamunnicar data from the XLS file
import pandas as pd
import pkg_resources
import logging
import os
def extract_salamuniccar(filename, tables=None,
output_prefix=None,
output_filename=None):
"""Extract the lat,long, diameter from the Salamuniccar ca... | 36.8 | 84 | 0.610637 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 426 | 0.165373 |
d916bdfd815b7553815cbe2979b5ff3c361b9fdb | 42 | py | Python | ARLO/environment/__init__.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | ARLO/environment/__init__.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | ARLO/environment/__init__.py | arlo-lib/ARLO | 159669884044686e36e07bd1cc0948884ed7cc8d | [
"MIT"
] | null | null | null | from ARLO.environment.environment import * | 42 | 42 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9175c1d53f0050bb3c406ad6da397071f06e203 | 3,558 | py | Python | orchestration/hca_orchestration/solids/load_hca/poll_ingest_job.py | DataBiosphere/hca-ingest | 1f5e8ad7450ff8caff3bb8c8d6b8f7acd8a37f68 | [
"BSD-3-Clause"
] | 5 | 2020-05-07T14:18:53.000Z | 2021-03-31T21:30:37.000Z | orchestration/hca_orchestration/solids/load_hca/poll_ingest_job.py | DataBiosphere/hca-ingest | 1f5e8ad7450ff8caff3bb8c8d6b8f7acd8a37f68 | [
"BSD-3-Clause"
] | 232 | 2020-05-28T16:47:22.000Z | 2022-03-08T21:08:42.000Z | orchestration/hca_orchestration/solids/load_hca/poll_ingest_job.py | DataBiosphere/hca-ingest | 1f5e8ad7450ff8caff3bb8c8d6b8f7acd8a37f68 | [
"BSD-3-Clause"
] | 1 | 2020-08-19T16:33:54.000Z | 2020-08-19T16:33:54.000Z | from typing import Optional
from dagster import solid, Int, Failure, Nothing, configured, String, DagsterLogManager
from dagster.core.execution.context.compute import AbstractComputeExecutionContext
from dagster_utils.typing import DagsterConfigDict
from data_repo_client import JobModel, ApiException, RepositoryApi
f... | 31.767857 | 115 | 0.697021 | 49 | 0.013772 | 0 | 0 | 2,034 | 0.571669 | 0 | 0 | 997 | 0.280214 |
d918edc1790e02527055eb43540fcf3985679871 | 10,533 | py | Python | print_chat.py | IVIGOR13/print_chat | 629bc9419f13d05e13e0224000bf8bf12058e605 | [
"MIT"
] | 1 | 2020-04-07T07:44:37.000Z | 2020-04-07T07:44:37.000Z | print_chat.py | IVIGOR13/print_chat | 629bc9419f13d05e13e0224000bf8bf12058e605 | [
"MIT"
] | null | null | null | print_chat.py | IVIGOR13/print_chat | 629bc9419f13d05e13e0224000bf8bf12058e605 | [
"MIT"
] | null | null | null | #
# Author: Igor Ivanov
# 2019
#
import time
import os
from termcolor import colored
from datetime import datetime
import colorama
colorama.init()
"""
Small print tool for implementing chat in the terminal
"""
class print_chat:
def _clear_screen(self):
os.system('cls' if os.name == 'nt' else 'clear')
... | 28.390836 | 97 | 0.475648 | 10,319 | 0.979683 | 0 | 0 | 0 | 0 | 0 | 0 | 897 | 0.085161 |
d91903929bd8b81abd126d6ed63db39059af5f91 | 321 | py | Python | cumulusci/robotframework/tests/CustomObjectTestPage.py | SalesforceFoundation/CumulusCI | f7811a881939ef86c10ccb9b2d7ec8d7af73fd1c | [
"BSD-3-Clause"
] | 109 | 2015-01-20T14:28:48.000Z | 2018-08-31T12:12:39.000Z | cumulusci/robotframework/tests/CustomObjectTestPage.py | SalesforceFoundation/CumulusCI | f7811a881939ef86c10ccb9b2d7ec8d7af73fd1c | [
"BSD-3-Clause"
] | 365 | 2015-01-07T19:54:25.000Z | 2018-09-11T15:10:02.000Z | cumulusci/robotframework/tests/CustomObjectTestPage.py | SalesforceFoundation/CumulusCI | f7811a881939ef86c10ccb9b2d7ec8d7af73fd1c | [
"BSD-3-Clause"
] | 125 | 2015-01-17T16:05:39.000Z | 2018-09-06T19:05:00.000Z | """
This class is used by test_pageobjects
"""
from cumulusci.robotframework.pageobjects import ListingPage, pageobject
# The point of this class is to test out using an alias
@pageobject(page_type="Listing", object_name="Custom Object")
class CustomObjectListingPage(ListingPage):
_object_name = "CustomObject__c"... | 29.181818 | 72 | 0.794393 | 80 | 0.249221 | 0 | 0 | 142 | 0.442368 | 0 | 0 | 142 | 0.442368 |
d919543d1b1062c7801bafa6f3961d97bf6f7fb6 | 850 | py | Python | src/settings.py | doksketch/happy-dating | 680c63f38fe039b6567f5fce94c3d0fa3b968019 | [
"MIT"
] | null | null | null | src/settings.py | doksketch/happy-dating | 680c63f38fe039b6567f5fce94c3d0fa3b968019 | [
"MIT"
] | null | null | null | src/settings.py | doksketch/happy-dating | 680c63f38fe039b6567f5fce94c3d0fa3b968019 | [
"MIT"
] | null | null | null | logreg_params = dict(multi_class='ovr',
class_weight=None,
random_state=43,
max_iter=300,
n_jobs=-1,
penalty='l2',
C=0.5)
rnn_params = dict(
# Пути к данным
df="../coleridgeinitiative-s... | 29.310345 | 68 | 0.615294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 301 | 0.324353 |
d91a437d3329267d3f78bc766ee6ddef015b51b1 | 1,741 | py | Python | examples/zio_console_example.py | miiohio/ziopy | c216bfb834f08bce0419a906b9bf174697d06023 | [
"MIT"
] | 28 | 2021-03-03T16:29:36.000Z | 2022-03-31T05:05:59.000Z | examples/zio_console_example.py | miiohio/ziopy | c216bfb834f08bce0419a906b9bf174697d06023 | [
"MIT"
] | 1 | 2019-10-08T20:09:47.000Z | 2019-10-08T20:09:47.000Z | examples/zio_console_example.py | harveywi/ziopy | c216bfb834f08bce0419a906b9bf174697d06023 | [
"MIT"
] | 1 | 2022-01-28T15:37:43.000Z | 2022-01-28T15:37:43.000Z | from typing import NoReturn, Union
import ziopy.services.console as console
import ziopy.services.system as system
from ziopy.environments import ConsoleSystemEnvironment
from ziopy.services.console import Console, LiveConsole
from ziopy.zio import ZIO, ZIOMonad, monadic, unsafe_run, Environment
@monadic
def program... | 27.203125 | 93 | 0.658817 | 0 | 0 | 0 | 0 | 1,057 | 0.607122 | 0 | 0 | 276 | 0.15853 |
d91ba473ca0e37b17defe052cdc5b0b0991183c2 | 1,872 | py | Python | examples/Classify/MNistLoader.py | parrisma/TicTacToe-DeepLearning | 4fefb1ef9d172eb19709f0f2a681307537769f58 | [
"MIT"
] | 1 | 2021-08-17T12:09:48.000Z | 2021-08-17T12:09:48.000Z | examples/Classify/MNistLoader.py | parrisma/TicTacToe-DeepLearning | 4fefb1ef9d172eb19709f0f2a681307537769f58 | [
"MIT"
] | null | null | null | examples/Classify/MNistLoader.py | parrisma/TicTacToe-DeepLearning | 4fefb1ef9d172eb19709f0f2a681307537769f58 | [
"MIT"
] | null | null | null | import os
import struct
import unittest
import numpy as np
#
# based on https://gist.github.com/akesling/5358964
# Which contains comment.
# > Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py
# > which is GPL licensed.
#
class MNistLoader:
@classmethod
def read_mnist(cls,
... | 25.643836 | 83 | 0.587073 | 1,405 | 0.750534 | 0 | 0 | 838 | 0.44765 | 0 | 0 | 458 | 0.244658 |
d91cabe506a537f69662d383acee8ad674a5d479 | 45,542 | py | Python | dlgo/zobrist.py | Woontopia/goBot | 5f343a7173f9fc65cc86b65f7addf8c423cf0530 | [
"MIT"
] | null | null | null | dlgo/zobrist.py | Woontopia/goBot | 5f343a7173f9fc65cc86b65f7addf8c423cf0530 | [
"MIT"
] | null | null | null | dlgo/zobrist.py | Woontopia/goBot | 5f343a7173f9fc65cc86b65f7addf8c423cf0530 | [
"MIT"
] | null | null | null | from .gotypes import Player, Point
__all__ = ['HASH_CODE', 'EMPTY_BOARD']
HASH_CODE = {
(Point(row=1, col=1), Player.black): 5769035980899136028,
(Point(row=1, col=1), Player.white): 4195353792250980257,
(Point(row=1, col=2), Player.black): 2939556709560817954,
(Point(row=1, col=2), Player.white): 770... | 62.386301 | 63 | 0.698081 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.000527 |
d91e5b227907a31856a0adc939b8a34e7e1a5f00 | 3,321 | py | Python | diagnostics/plots/dipole_vids.py | wheelerMT/spin-1_BEC | e8ea34699b4001847c6b4c7451c11be241ce598f | [
"MIT"
] | null | null | null | diagnostics/plots/dipole_vids.py | wheelerMT/spin-1_BEC | e8ea34699b4001847c6b4c7451c11be241ce598f | [
"MIT"
] | null | null | null | diagnostics/plots/dipole_vids.py | wheelerMT/spin-1_BEC | e8ea34699b4001847c6b4c7451c11be241ce598f | [
"MIT"
] | null | null | null | import h5py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# Load in data:
filename = input('Enter data filename: ')
data_file = h5py.File('../../data/{}.hdf5'.format(filename), 'r')
psi_plus = data_file['wavefunction/psi_plus']
psi_0 = data_file['wavefunction/psi_0']
psi_... | 39.070588 | 118 | 0.620897 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 723 | 0.217706 |
d9204110ecad2e306b5e55fed3bce1fe83582fab | 618 | py | Python | sources/boltun/ext/yaml/processor.py | meiblorn/boltun | d141f555b4f0ed604d8d71883c0bc8811e74370e | [
"MIT"
] | 1 | 2019-12-06T04:19:37.000Z | 2019-12-06T04:19:37.000Z | sources/boltun/ext/yaml/processor.py | meiblorn/boltun | d141f555b4f0ed604d8d71883c0bc8811e74370e | [
"MIT"
] | null | null | null | sources/boltun/ext/yaml/processor.py | meiblorn/boltun | d141f555b4f0ed604d8d71883c0bc8811e74370e | [
"MIT"
] | null | null | null | import attr
import yaml
from boltun.engine import Engine
@attr.s
class YamlProcessor(object):
engine = attr.ib(default=attr.Factory(Engine))
def __enable__(self, tag="!boltun", resolver=False):
yaml.add_constructor(tag, self)
if resolver:
yaml.add_implicit_resolver(tag, self._ma... | 22.888889 | 58 | 0.653722 | 549 | 0.88835 | 0 | 0 | 557 | 0.901294 | 0 | 0 | 9 | 0.014563 |
d924124b049efba8b327f8ba79867faeb73cd170 | 681 | py | Python | cvk_2015/apps.py | dchaplinsky/ragoogle | dccb3d29334c3220ea12c46c725c443c8bd725c0 | [
"MIT"
] | 3 | 2018-06-10T21:20:56.000Z | 2021-04-04T11:21:06.000Z | cvk_2015/apps.py | dchaplinsky/ragoogle | dccb3d29334c3220ea12c46c725c443c8bd725c0 | [
"MIT"
] | 7 | 2018-08-14T20:54:49.000Z | 2020-06-05T18:17:30.000Z | cvk_2015/apps.py | dchaplinsky/ragoogle | dccb3d29334c3220ea12c46c725c443c8bd725c0 | [
"MIT"
] | 3 | 2018-06-27T12:53:13.000Z | 2020-09-25T19:41:46.000Z | from abstract.apps import AbstractConfig
from .loader import CVK2015Loader
from .elastic_models import ElasticCVK2015Model, cvk_2015_idx
class CVK2015Config(AbstractConfig):
name = "cvk_2015"
verbose_name = "Учасники місцевих виборів 2015-го року"
short_name = "Регіони"
loader_class = CVK2015Loader
... | 27.24 | 61 | 0.728341 | 578 | 0.806137 | 0 | 0 | 274 | 0.382148 | 0 | 0 | 148 | 0.206416 |
d924de18914aff5fa9f08bc65617db228d203fc4 | 2,296 | py | Python | gen_sample_by_PIL.py | chldong/cnn_captcha | 3c528ac30b6278bc55f04ac0dd565985ef4d5f52 | [
"Apache-2.0"
] | null | null | null | gen_sample_by_PIL.py | chldong/cnn_captcha | 3c528ac30b6278bc55f04ac0dd565985ef4d5f52 | [
"Apache-2.0"
] | null | null | null | gen_sample_by_PIL.py | chldong/cnn_captcha | 3c528ac30b6278bc55f04ac0dd565985ef4d5f52 | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
使用PIL lib生成验证码(前提:pip install PIL)
"""
from PIL import Image,ImageFont,ImageDraw,ImageFilter
import os
import random
import time
import json
def gen_special_img(text, file_path, width, height):
# 生成img文件
fontSize = 16
backGroundColor = (102,142,107)
fontColor = (112,66,60)
... | 30.210526 | 104 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 742 | 0.300162 |
d92522c94e17430f94254dced6800a868fcfd052 | 30,022 | py | Python | transfer/trainers.py | 0e4e6d01/non-parallel-text-style-transfer-using-self-attn-discriminator | c24a47cc96033cf960ed272810b9b7226f25e899 | [
"Apache-2.0"
] | null | null | null | transfer/trainers.py | 0e4e6d01/non-parallel-text-style-transfer-using-self-attn-discriminator | c24a47cc96033cf960ed272810b9b7226f25e899 | [
"Apache-2.0"
] | null | null | null | transfer/trainers.py | 0e4e6d01/non-parallel-text-style-transfer-using-self-attn-discriminator | c24a47cc96033cf960ed272810b9b7226f25e899 | [
"Apache-2.0"
] | null | null | null | import os
import time
import csv
import pickle
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data.dataloader import DataLoader
from torch.nn.utils import clip_grad_norm_ as clip_grad_norm
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt... | 42.047619 | 112 | 0.558824 | 26,525 | 0.883519 | 0 | 0 | 0 | 0 | 0 | 0 | 4,455 | 0.148391 |
d925d3037892fd1d955e34998895dbcfac60e539 | 561 | py | Python | module2-sql-for-analysis/elephant_queries.py | techthumb1/DS-Unit-3-Sprint-2-SQL-and-Databases | a9d961ded99bb11e444151b6f450cb7e5b34ed83 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/elephant_queries.py | techthumb1/DS-Unit-3-Sprint-2-SQL-and-Databases | a9d961ded99bb11e444151b6f450cb7e5b34ed83 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/elephant_queries.py | techthumb1/DS-Unit-3-Sprint-2-SQL-and-Databases | a9d961ded99bb11e444151b6f450cb7e5b34ed83 | [
"MIT"
] | null | null | null | import psycopg2
# import sqlite3
DB_NAME = "ekasuicm"
DB_USER = "ekasuicm"
DB_PASSWORD = "5xL04dTyJuqjmPNeDPWsHjZsCnMmqpbM"
DB_HOST = "ruby.db.elephantsql.com"
connection = psycopg2.connect(dbname=DB_NAME, user=DB_USER,
password=DB_PASSWORD, host=DB_HOST)
print("CONNECTION", ... | 23.375 | 66 | 0.680927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.258467 |
d925f20fe6fe0eccd5e8c08b7081757ad19c44be | 3,414 | py | Python | privatefsbot.py | l0k9j8/fstgbot | 6b20d28466ecc97e09f0a3919d43a3c4d1a82357 | [
"MIT"
] | null | null | null | privatefsbot.py | l0k9j8/fstgbot | 6b20d28466ecc97e09f0a3919d43a3c4d1a82357 | [
"MIT"
] | null | null | null | privatefsbot.py | l0k9j8/fstgbot | 6b20d28466ecc97e09f0a3919d43a3c4d1a82357 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
from telegram import Updater
from commands import history, cat, cd, get, ls, pwd, save
from sett... | 34.14 | 102 | 0.668131 | 0 | 0 | 0 | 0 | 2,203 | 0.642649 | 0 | 0 | 399 | 0.116394 |