hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
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
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
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
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
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
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f710770cd6b6cc55fa5e3661cb8e82cfeb494a6f
313
py
Python
console/widgets/extra.py
dustinlacewell/console
b65f63354dd8ba60f211e3e169e53c078b99fdf8
[ "MIT" ]
11
2015-06-10T22:23:03.000Z
2021-02-16T10:55:55.000Z
console/widgets/extra.py
rrosajp/console
b65f63354dd8ba60f211e3e169e53c078b99fdf8
[ "MIT" ]
1
2015-07-01T00:04:50.000Z
2015-08-19T16:40:18.000Z
console/widgets/extra.py
rrosajp/console
b65f63354dd8ba60f211e3e169e53c078b99fdf8
[ "MIT" ]
5
2015-06-20T11:08:32.000Z
2022-03-07T00:01:50.000Z
import urwid class AlwaysFocusedEdit(urwid.Edit): """ This Edit widget is convinced that it is always in focus. This is so that it will respond to input events even if it isn't.' """ def render(self, size, focus=False): return super(AlwaysFocusedEdit, self).render(size, focus=True)
28.454545
77
0.690096
import urwid class AlwaysFocusedEdit(urwid.Edit): def render(self, size, focus=False): return super(AlwaysFocusedEdit, self).render(size, focus=True)
true
true
f7107796de3cb4b1078c5b12ab816311e6504df2
3,833
py
Python
ui/tests/test_base.py
iqre8/kubeinit
ef5988e8b8649452bb9c94f465add4626a660def
[ "Apache-2.0" ]
null
null
null
ui/tests/test_base.py
iqre8/kubeinit
ef5988e8b8649452bb9c94f465add4626a660def
[ "Apache-2.0" ]
null
null
null
ui/tests/test_base.py
iqre8/kubeinit
ef5988e8b8649452bb9c94f465add4626a660def
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """ Copyright 2019 Kubeinit (kubeinit.com). 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 ...
24.729032
75
0.559614
from logging import CRITICAL, disable disable(CRITICAL) urls = { '': ( '/fixed_sidebar', '/fixed_footer', '/plain_page', '/page_403', '/page_404', '/page_500' ), '/home': ( '/index', '/index2', '/index3' ), '/forms': ( ...
true
true
f71077ad9b03cf9d6c21b1546d2812ac45c55448
1,010
py
Python
Examples/first_vscode/robot2.py
slowrunner/GoPiLgc
e86505d83b2d2e7b1c5c2a04c1eed19774cf76b0
[ "CC0-1.0" ]
null
null
null
Examples/first_vscode/robot2.py
slowrunner/GoPiLgc
e86505d83b2d2e7b1c5c2a04c1eed19774cf76b0
[ "CC0-1.0" ]
null
null
null
Examples/first_vscode/robot2.py
slowrunner/GoPiLgc
e86505d83b2d2e7b1c5c2a04c1eed19774cf76b0
[ "CC0-1.0" ]
null
null
null
#!/usr/bin/python3 # FILE: robot2.py # PURPOSE: Test reading distance sensor and ultrasonic sensor from easygopigo3 import EasyGoPiGo3 import time import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(funcName)s: %(message)s') DIODE_DROP = 0.7 ULTRASONIC_CORRECTION_AT_100mm = 17.0 # mm ToF_C...
28.055556
111
0.654455
from easygopigo3 import EasyGoPiGo3 import time import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(funcName)s: %(message)s') DIODE_DROP = 0.7 ULTRASONIC_CORRECTION_AT_100mm = 17.0 ToF_CORRECTION_AT_100mm = -5.0 def main(): egpg = EasyGoPiGo3(use_mutex=True) egpg.ds = egpg.in...
true
true
f71077dfaecb2df505c4d5574b2fd9f2d6699926
3,190
py
Python
app.py
sejaldua/duolingogogo
226a2a9417238f9c3f0ce738d491b58cdf4dcbdc
[ "MIT" ]
null
null
null
app.py
sejaldua/duolingogogo
226a2a9417238f9c3f0ce738d491b58cdf4dcbdc
[ "MIT" ]
null
null
null
app.py
sejaldua/duolingogogo
226a2a9417238f9c3f0ce738d491b58cdf4dcbdc
[ "MIT" ]
null
null
null
import streamlit as st import pandas as pd import yaml import duolingo import seaborn as sns import matplotlib.pyplot as plt import matplotlib.font_manager from datetime import timezone, timedelta matplotlib.rcParams['font.family'] = ['Source Han Sans CN'] with open("duo_credentials.yaml", 'r') as stream: creds = ...
43.108108
145
0.70094
import streamlit as st import pandas as pd import yaml import duolingo import seaborn as sns import matplotlib.pyplot as plt import matplotlib.font_manager from datetime import timezone, timedelta matplotlib.rcParams['font.family'] = ['Source Han Sans CN'] with open("duo_credentials.yaml", 'r') as stream: creds = ...
true
true
f71077e6e85282814575b8276103abfbb46cbf21
25,589
py
Python
big-fish/bigfish/stack/postprocess.py
Henley13/paper_translation_factories_2020
77558ed70467cf91062abf62e46c794bfbc08e4a
[ "BSD-3-Clause" ]
2
2020-09-03T20:50:53.000Z
2020-10-02T14:39:31.000Z
big-fish/bigfish/stack/postprocess.py
Henley13/paper_translation_factories_2020
77558ed70467cf91062abf62e46c794bfbc08e4a
[ "BSD-3-Clause" ]
4
2020-01-15T10:26:14.000Z
2020-10-01T18:36:39.000Z
big-fish/bigfish/stack/postprocess.py
Henley13/paper_translation_factories_2020
77558ed70467cf91062abf62e46c794bfbc08e4a
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """ Functions used to format and clean any intermediate results loaded in or returned by a bigfish method. """ import numpy as np from scipy import ndimage as ndi from .utils import check_array, check_parameter, get_offset_value from skimage.measure import regionprops, find_contours from ski...
34.57973
79
0.626754
import numpy as np from scipy import ndimage as ndi from .utils import check_array, check_parameter, get_offset_value from skimage.measure import regionprops, find_contours from skimage.draw import polygon_perimeter (mask_nuc, ndim=2, dtype=[bool], allow_nan=False)...
true
true
f710797ab784835c1442fbb48d68ecbf113174ad
88
py
Python
det3d/datasets/waymo/__init__.py
alsun-oven/CenterPoint
cafd89c4008270e648e97202bc256aff968e8109
[ "MIT" ]
1,124
2020-06-22T00:48:18.000Z
2022-03-31T22:03:35.000Z
det3d/datasets/waymo/__init__.py
alsun-oven/CenterPoint
cafd89c4008270e648e97202bc256aff968e8109
[ "MIT" ]
290
2020-06-23T01:29:04.000Z
2022-03-29T16:27:32.000Z
det3d/datasets/waymo/__init__.py
alsun-oven/CenterPoint
cafd89c4008270e648e97202bc256aff968e8109
[ "MIT" ]
326
2020-06-22T01:48:10.000Z
2022-03-31T08:15:08.000Z
from .waymo import WaymoDataset from .waymo_common import * __all__ = ["WaymoDataset"]
17.6
31
0.772727
from .waymo import WaymoDataset from .waymo_common import * __all__ = ["WaymoDataset"]
true
true
f7107b0890bd09696c94ec6fab76c27c05bdde01
6,696
py
Python
deprecated/code/datacleaning.py
metamoles/metamoles
251de6672029566d8becf2538684c0506fc297d0
[ "MIT" ]
3
2019-04-04T22:44:00.000Z
2020-07-30T18:16:56.000Z
deprecated/code/datacleaning.py
metamoles/metamoles
251de6672029566d8becf2538684c0506fc297d0
[ "MIT" ]
null
null
null
deprecated/code/datacleaning.py
metamoles/metamoles
251de6672029566d8becf2538684c0506fc297d0
[ "MIT" ]
null
null
null
#!/usr/bin/env python import Bio from Bio.KEGG import REST from Bio.KEGG import Enzyme import re from Bio.KEGG import Compound import gzip import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns def create_enzyme_df(path_to_file): """ input:path_to...
30.162162
172
0.670251
import Bio from Bio.KEGG import REST from Bio.KEGG import Enzyme import re from Bio.KEGG import Compound import gzip import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns def create_enzyme_df(path_to_file): enzyme_fields = [method for method in dir...
true
true
f7107b1d4396af6ead7cd03880a25ba2d1787e88
12,815
py
Python
TP07 PB.py
JPFigueredo/Hardware-Monitoring-System_Incomplete-Version
c8bcec269907382ea07c0355b2314007dcb36821
[ "Apache-2.0" ]
1
2021-08-06T19:55:34.000Z
2021-08-06T19:55:34.000Z
TP07 PB.py
JPFigueredo/Hardware-Monitoring-System_Incomplete-Version
c8bcec269907382ea07c0355b2314007dcb36821
[ "Apache-2.0" ]
null
null
null
TP07 PB.py
JPFigueredo/Hardware-Monitoring-System_Incomplete-Version
c8bcec269907382ea07c0355b2314007dcb36821
[ "Apache-2.0" ]
null
null
null
import pygame import psutil import cpuinfo import socket import time import nmap from cpuinfo import get_cpu_info red = (200,0,0) white = (210,214,217) blue = (0,0,200) grey = (105,105,105) black = (0,0,0) largura_tela, altura_tela = 1024,760 pygame.init() pygame.font.init() font = pygame.font.Font(N...
36.40625
119
0.569957
import pygame import psutil import cpuinfo import socket import time import nmap from cpuinfo import get_cpu_info red = (200,0,0) white = (210,214,217) blue = (0,0,200) grey = (105,105,105) black = (0,0,0) largura_tela, altura_tela = 1024,760 pygame.init() pygame.font.init() font = pygame.font.Font(N...
true
true
f7107ca561761e166b2411668c743cfd45a39430
453
py
Python
crawler/crawler/items.py
suchkultur/trueffelschwein
189ffccb8a26d852107ab66d055879c39f7dcebd
[ "MIT" ]
null
null
null
crawler/crawler/items.py
suchkultur/trueffelschwein
189ffccb8a26d852107ab66d055879c39f7dcebd
[ "MIT" ]
null
null
null
crawler/crawler/items.py
suchkultur/trueffelschwein
189ffccb8a26d852107ab66d055879c39f7dcebd
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy from scrapy.item import Item, Field class CrawlerItem(scrapy.Item): url = Field() html_title = Field() html_h1 = Field() html_h2 = Field...
19.695652
51
0.637969
import scrapy from scrapy.item import Item, Field class CrawlerItem(scrapy.Item): url = Field() html_title = Field() html_h1 = Field() html_h2 = Field() html_h3 = Field() html_h4 = Field() html_h5 = Field() html_h6 = Field() html_p = Field() html_a = Field()
true
true
f7107dc6017ef5f07ab6acc581e8700372001f5a
391
py
Python
src/application/tables/table.py
cruz-f/protrend
b72c17fa1606b4cf5ca6d60c51737b43ba3fdbc1
[ "MIT" ]
null
null
null
src/application/tables/table.py
cruz-f/protrend
b72c17fa1606b4cf5ca6d60c51737b43ba3fdbc1
[ "MIT" ]
1
2022-02-11T18:38:39.000Z
2022-02-11T18:38:39.000Z
src/application/tables/table.py
cruz-f/protrend
b72c17fa1606b4cf5ca6d60c51737b43ba3fdbc1
[ "MIT" ]
null
null
null
class Table: context = '' fields = () columns = () sortable = () types = () def context_dict(self): return {field: {'field': field, 'column': col, 'sortable': sort, 'type': type_} for field, col, sor...
27.928571
105
0.460358
class Table: context = '' fields = () columns = () sortable = () types = () def context_dict(self): return {field: {'field': field, 'column': col, 'sortable': sort, 'type': type_} for field, col, sor...
true
true
f7107f13b8744297c5a93ee8a1e0309058d01042
2,855
py
Python
moxom/compiler/astparser.py
sikrinick/moxom
75e1e59b93ea1c8eea2141c0105d083089e25ca9
[ "MIT" ]
4
2020-10-26T01:06:37.000Z
2022-02-02T18:35:03.000Z
moxom/compiler/astparser.py
sikrinick/moxom
75e1e59b93ea1c8eea2141c0105d083089e25ca9
[ "MIT" ]
null
null
null
moxom/compiler/astparser.py
sikrinick/moxom
75e1e59b93ea1c8eea2141c0105d083089e25ca9
[ "MIT" ]
null
null
null
from dataclasses import dataclass from moxom.compiler.lexer import OperatorToken, IdentifierToken, AtomTokens from typing import Union, Optional from .cstparser import CstNode, Expr import ast from moxom.compiler.operators import operator_dict, AssignOperator, AndOperator, ThenOperator @dataclass class AtomNode: ...
32.078652
93
0.6669
from dataclasses import dataclass from moxom.compiler.lexer import OperatorToken, IdentifierToken, AtomTokens from typing import Union, Optional from .cstparser import CstNode, Expr import ast from moxom.compiler.operators import operator_dict, AssignOperator, AndOperator, ThenOperator @dataclass class AtomNode: ...
true
true
f7107f1666c8b67e52460354f9330b8c3525187e
2,776
py
Python
classify_ternary.py
boscotsang/BayesDigitClassify
8087cd8de2cefe1f5247894ee6ce617872bfea2a
[ "MIT" ]
2
2016-03-13T08:24:29.000Z
2018-04-19T12:46:02.000Z
classify_ternary.py
boscotsang/BayesDigitClassify
8087cd8de2cefe1f5247894ee6ce617872bfea2a
[ "MIT" ]
1
2015-11-08T18:22:38.000Z
2015-11-09T00:12:45.000Z
classify_ternary.py
boscotsang/BayesDigitClassify
8087cd8de2cefe1f5247894ee6ce617872bfea2a
[ "MIT" ]
null
null
null
import numpy from sklearn.metrics import confusion_matrix def load_data(): train_labels = [] with open('digitdata/traininglabels', 'rb') as f: for i, line in enumerate(f): train_labels.append(int(line)) train_labels = numpy.array(train_labels, dtype=int) train_x = numpy.zeros((trai...
36.051948
99
0.548271
import numpy from sklearn.metrics import confusion_matrix def load_data(): train_labels = [] with open('digitdata/traininglabels', 'rb') as f: for i, line in enumerate(f): train_labels.append(int(line)) train_labels = numpy.array(train_labels, dtype=int) train_x = numpy.zeros((trai...
false
true
f7107f2436acaf4ce2118c270a01d52b337bb5df
20,619
py
Python
lib/surface/init.py
bopopescu/Google-Cloud-SDK-1
c4683bacb2f6192d8a816932e438a0493085469b
[ "Apache-2.0" ]
null
null
null
lib/surface/init.py
bopopescu/Google-Cloud-SDK-1
c4683bacb2f6192d8a816932e438a0493085469b
[ "Apache-2.0" ]
null
null
null
lib/surface/init.py
bopopescu/Google-Cloud-SDK-1
c4683bacb2f6192d8a816932e438a0493085469b
[ "Apache-2.0" ]
1
2020-07-24T20:13:29.000Z
2020-07-24T20:13:29.000Z
# Copyright 2014 Google Inc. All Rights Reserved. # # 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 ag...
41.073705
80
0.668461
import os from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions as c_exc from googlecloudsdk.calliope import usage_text from googlecloudsdk.command_lib import init_util from googlecloudsdk.core import config from googlecloudsdk.core import execution_utils from googleclo...
true
true
f7107fda7c5bfabbde90193d9508ada61985db57
1,954
py
Python
.cf_status.py
pointtonull/888
a7a576a91c92b76f9e4d33e8f7ef83cbe9e68429
[ "MIT" ]
null
null
null
.cf_status.py
pointtonull/888
a7a576a91c92b76f9e4d33e8f7ef83cbe9e68429
[ "MIT" ]
null
null
null
.cf_status.py
pointtonull/888
a7a576a91c92b76f9e4d33e8f7ef83cbe9e68429
[ "MIT" ]
null
null
null
import json from pprint import pprint, pformat from dateutil.parser import parse as parsetimestamp SILENCE_STATUSES = [ "CREATE_COMPLETE", "CREATE_IN_PROGRESS", "DELETE_COMPLETE", "DELETE_IN_PROGRESS", "REVIEW_IN_PROGRESS", "ROLLBACK_COMPLETE", "ROLLBACK_IN_PRO...
27.521127
67
0.627943
import json from pprint import pprint, pformat from dateutil.parser import parse as parsetimestamp SILENCE_STATUSES = [ "CREATE_COMPLETE", "CREATE_IN_PROGRESS", "DELETE_COMPLETE", "DELETE_IN_PROGRESS", "REVIEW_IN_PROGRESS", "ROLLBACK_COMPLETE", "ROLLBACK_IN_PRO...
true
true
f710810b12384c37843d991e733d7c74f738237f
1,160
py
Python
tflitehub/mobilenet_quant_test.py
rsuderman/iree-samples
e7ba8e639c1bdd763793a6cf21930fb238607b3f
[ "Apache-2.0" ]
12
2021-08-18T07:01:50.000Z
2022-03-30T18:19:12.000Z
tflitehub/mobilenet_quant_test.py
rsuderman/iree-samples
e7ba8e639c1bdd763793a6cf21930fb238607b3f
[ "Apache-2.0" ]
10
2021-09-29T01:23:47.000Z
2022-03-25T21:59:04.000Z
tflitehub/mobilenet_quant_test.py
rsuderman/iree-samples
e7ba8e639c1bdd763793a6cf21930fb238607b3f
[ "Apache-2.0" ]
12
2021-09-09T00:58:53.000Z
2022-03-03T17:35:32.000Z
# RUN: %PYTHON %s import absl.testing import numpy import test_util import urllib.request from PIL import Image model_path = "https://tfhub.dev/tensorflow/lite-model/mobilenet_v2_1.0_224_quantized/1/default/1?lite-format=tflite" class MobilenetQuantTest(test_util.TFLiteModelTest): def __init__(self, *args, **kwar...
33.142857
116
0.743966
import absl.testing import numpy import test_util import urllib.request from PIL import Image model_path = "https://tfhub.dev/tensorflow/lite-model/mobilenet_v2_1.0_224_quantized/1/default/1?lite-format=tflite" class MobilenetQuantTest(test_util.TFLiteModelTest): def __init__(self, *args, **kwargs): super(Mo...
true
true
f7108151b0c3aa3b406dfde25785279e911d6bea
6,443
py
Python
logtools/_parse.py
AlainLich/logtools
584e575d25f0ebcd7a51cc6d5aefb530f80f6d22
[ "Apache-2.0" ]
2
2021-06-08T21:48:18.000Z
2022-03-09T05:50:13.000Z
logtools/_parse.py
AlainLich/logtools
584e575d25f0ebcd7a51cc6d5aefb530f80f6d22
[ "Apache-2.0" ]
null
null
null
logtools/_parse.py
AlainLich/logtools
584e575d25f0ebcd7a51cc6d5aefb530f80f6d22
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # # 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, so...
38.580838
121
0.609809
import sys import logging from operator import and_ from optparse import OptionParser from functools import reduce import json import logtools.parsers import logtools.parsers2 from ._config import interpolate_config, AttrDict, setLoglevel from ._config import checkDpath from .parsers2 import File...
true
true
f710824ba7efc8a20fbc9c9d7564eb2072eb8db2
9,663
py
Python
contrib/bitrpc/bitrpc.py
raininfotech/Guapcoin
3df58f6d5ffab0d6c4c97fb79ad9722891fad528
[ "MIT" ]
13
2019-08-13T19:32:50.000Z
2022-03-03T19:41:54.000Z
contrib/bitrpc/bitrpc.py
ykbynr/bitesax
fdad51203125032739da3466fe97c41e48948274
[ "MIT" ]
12
2020-02-02T17:48:50.000Z
2022-03-10T21:27:20.000Z
contrib/bitrpc/bitrpc.py
ykbynr/bitesax
fdad51203125032739da3466fe97c41e48948274
[ "MIT" ]
13
2019-08-02T21:03:28.000Z
2021-06-09T05:10:22.000Z
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9634") e...
28.588757
101
0.573424
from jsonrpc import ServiceProxy import sys import string import getpass rpcuser = "" rpcpass = "" if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9634") else: access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:9634") cmd = sys.argv[1].lower() if cmd == "backupwallet": try: ...
false
true
f7108264cb02420e9950c61ae9763e056ed2199c
807
py
Python
Core Concepts/Deep Learning/3_RELU_activation_function.py
WyckliffeAluga/data-chronicles
5219fe9cdbafb9fd7be88727483952c4c13f2790
[ "MIT" ]
null
null
null
Core Concepts/Deep Learning/3_RELU_activation_function.py
WyckliffeAluga/data-chronicles
5219fe9cdbafb9fd7be88727483952c4c13f2790
[ "MIT" ]
null
null
null
Core Concepts/Deep Learning/3_RELU_activation_function.py
WyckliffeAluga/data-chronicles
5219fe9cdbafb9fd7be88727483952c4c13f2790
[ "MIT" ]
1
2021-02-09T12:22:55.000Z
2021-02-09T12:22:55.000Z
import numpy as np def relu(input): '''Define your relu activation function here''' # Calculate the value for the output of the relu function: output output = max(input, 0) # Return the value just calculated return(output) input_data = np.array([3,5]) # Calculate node 0 value: node_0_output ...
27.827586
69
0.739777
import numpy as np def relu(input): output = max(input, 0) return(output) input_data = np.array([3,5]) node_0_input = (input_data * weights['node_0']).sum() node_0_output = relu(node_0_input) node_1_input = (input_data * weights['node_1']).sum() node_1_output = relu(node_1_input) hidden_l...
true
true
f7108274340407b2057c752d7910bfe615395f11
28,071
py
Python
misc/config_tools/launch_config/com.py
lifeix/acrn-hypervisor
0d12dacc2549c72a96b3703d6cfe900ed904c302
[ "BSD-3-Clause" ]
null
null
null
misc/config_tools/launch_config/com.py
lifeix/acrn-hypervisor
0d12dacc2549c72a96b3703d6cfe900ed904c302
[ "BSD-3-Clause" ]
1
2021-07-26T22:16:18.000Z
2021-07-26T22:16:18.000Z
misc/config_tools/launch_config/com.py
Surfndez/acrn-hypervisor
69fef2e685597e51ce2103e8701e90d210ec0640
[ "BSD-3-Clause" ]
null
null
null
# Copyright (C) 2019 Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # import scenario_cfg_lib import launch_cfg_lib import common import pt def is_nuc_whl_linux(names, vmid): uos_type = names['uos_types'][vmid] board_name = names['board_name'] if launch_cfg_lib.is_linu...
40.565029
144
0.5858
import scenario_cfg_lib import launch_cfg_lib import common import pt def is_nuc_whl_linux(names, vmid): uos_type = names['uos_types'][vmid] board_name = names['board_name'] if launch_cfg_lib.is_linux_like(uos_type) and board_name not in ("apl-mrb", "apl-up2"): return True return False ...
true
true
f71082af93d1c265ed09483c58f606154391284b
11,088
py
Python
astro_dynamo/model.py
cwegg/astro-dynamo
024f8aad8785488e9ae3328095d3d9c53b3e31b0
[ "MIT" ]
null
null
null
astro_dynamo/model.py
cwegg/astro-dynamo
024f8aad8785488e9ae3328095d3d9c53b3e31b0
[ "MIT" ]
null
null
null
astro_dynamo/model.py
cwegg/astro-dynamo
024f8aad8785488e9ae3328095d3d9c53b3e31b0
[ "MIT" ]
null
null
null
import math from typing import List, Union, Tuple import torch import torch.nn as nn from astro_dynamo.snap import SnapShot from .snaptools import align_bar def _symmetrize_matrix(x, dim): """Symmetrize a tensor along dimension dim""" return (x + x.flip(dims=[dim])) / 2 class DynamicalModel(nn.Module): ...
45.818182
123
0.578734
import math from typing import List, Union, Tuple import torch import torch.nn as nn from astro_dynamo.snap import SnapShot from .snaptools import align_bar def _symmetrize_matrix(x, dim): return (x + x.flip(dims=[dim])) / 2 class DynamicalModel(nn.Module): def __init__(self, snap, potentials, targets, s...
true
true
f710835d66959fdc467c2e264eac9c235841223e
6,455
py
Python
src/dataset/transforms.py
HennyJie/BrainGB
96cf6711e2f2e6fa48b699ce3c0d6e318955c4de
[ "MIT" ]
3
2022-03-17T01:34:49.000Z
2022-03-22T07:53:17.000Z
src/dataset/transforms.py
HennyJie/BrainGB
96cf6711e2f2e6fa48b699ce3c0d6e318955c4de
[ "MIT" ]
null
null
null
src/dataset/transforms.py
HennyJie/BrainGB
96cf6711e2f2e6fa48b699ce3c0d6e318955c4de
[ "MIT" ]
null
null
null
import torch from node2vec import Node2Vec as Node2Vec_ from .brain_data import BrainData from torch_geometric.data import Data from networkx.convert_matrix import from_numpy_matrix from .utils import binning, LDP import networkx as nx from .base_transform import BaseTransform from numpy import linalg as LA import nump...
33.273196
104
0.604028
import torch from node2vec import Node2Vec as Node2Vec_ from .brain_data import BrainData from torch_geometric.data import Data from networkx.convert_matrix import from_numpy_matrix from .utils import binning, LDP import networkx as nx from .base_transform import BaseTransform from numpy import linalg as LA import nump...
true
true
f710836a29ffda363d4610fc11190b6952224671
2,208
py
Python
tensorflow_probability/python/bijectors/tanh.py
oahziur/probability
11645be43d2845da65a4fbafde4cfa95780280c0
[ "Apache-2.0" ]
1
2020-04-29T11:29:25.000Z
2020-04-29T11:29:25.000Z
tensorflow_probability/python/bijectors/tanh.py
jinxin0924/probability
ca14fa8924749593fd21e2b6389551f964527eec
[ "Apache-2.0" ]
null
null
null
tensorflow_probability/python/bijectors/tanh.py
jinxin0924/probability
ca14fa8924749593fd21e2b6389551f964527eec
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 The TensorFlow Probability Authors. # # 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 o...
29.837838
80
0.639493
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow_probability.python.bijectors import bijector __all__ = [ "Tanh", ] class Tanh(bijector.Bijector): def __init__(self, validate...
true
true
f71084351b782abccdb2e0b46a99a1a1615969c0
8,206
py
Python
qualcoder/settings.py
WPFilmmaker/QualCoder
6d9529031358e3f85ef702a99e6ccfedb59efcd5
[ "MIT" ]
null
null
null
qualcoder/settings.py
WPFilmmaker/QualCoder
6d9529031358e3f85ef702a99e6ccfedb59efcd5
[ "MIT" ]
null
null
null
qualcoder/settings.py
WPFilmmaker/QualCoder
6d9529031358e3f85ef702a99e6ccfedb59efcd5
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ''' Copyright (c) 2019 Colin Curtain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, mer...
44.11828
117
0.672069
from PyQt5 import QtGui, QtWidgets, QtCore import os import sys import logging import traceback from GUI.ui_dialog_settings import Ui_Dialog_settings home = os.path.expanduser('~') path = os.path.abspath(os.path.dirname(__file__)) logger = logging.getLogger(__name__) def exception_handler(exception_type, value, t...
true
true
f710846c80ef3b7e1dcd8677b178febf876f4ee5
126
py
Python
flask_sample_program.py
Divya-Madhuri/ppty_mgmnt
c57c2dbdb5ecc224b825e8e084c228085d6ff5e7
[ "MIT" ]
null
null
null
flask_sample_program.py
Divya-Madhuri/ppty_mgmnt
c57c2dbdb5ecc224b825e8e084c228085d6ff5e7
[ "MIT" ]
10
2018-07-11T08:59:26.000Z
2018-11-11T07:47:07.000Z
flask_sample_program.py
Divya-Madhuri/ppty_mgmnt
c57c2dbdb5ecc224b825e8e084c228085d6ff5e7
[ "MIT" ]
null
null
null
from flask import Flask app = Flask(__name__) @app.route("/") def sample_program(): return "This is sample flask program"
21
41
0.722222
from flask import Flask app = Flask(__name__) @app.route("/") def sample_program(): return "This is sample flask program"
true
true
f7108483ad3c1914253cfd40c32a82dfd588c569
40,664
py
Python
zerocloud/tarstream.py
joyrahman/zerocloud
d4f25b9cfe6d5103e851c4a300fe73508a991e63
[ "Apache-2.0" ]
25
2015-01-12T01:53:40.000Z
2021-06-13T12:01:25.000Z
zerocloud/tarstream.py
joyrahman/zerocloud
d4f25b9cfe6d5103e851c4a300fe73508a991e63
[ "Apache-2.0" ]
7
2015-01-05T13:15:04.000Z
2015-04-08T13:11:36.000Z
zerocloud/tarstream.py
joyrahman/zerocloud
d4f25b9cfe6d5103e851c4a300fe73508a991e63
[ "Apache-2.0" ]
7
2015-03-26T16:28:16.000Z
2018-11-12T18:34:50.000Z
# --------- # Imports # --------- import sys import os import stat import time import struct import re try: import grp import pwd except ImportError: grp = pwd = None # --------------------------------------------------------- # tar constants # --------------------------------------------------------- N...
32.044129
79
0.532928
import sys import os import stat import time import struct import re try: import grp import pwd except ImportError: grp = pwd = None NUL = "\0" BLOCKSIZE = 512 RECORDSIZE = BLOCKSIZE * 20 GNU_MAGIC = "ustar \0" POSIX_MAGIC = "ustar\x0000" L...
false
true
f71084b377e3e20e5a56b4a9157457bd9cae1d35
3,397
py
Python
src/lib/searchio/cli.py
cgxxv/alfred-searchio
f4a14cbe5350b83d6d962aa993abf01f14b60d33
[ "MIT" ]
304
2015-01-15T08:18:47.000Z
2022-03-31T10:41:52.000Z
src/lib/searchio/cli.py
cgxxv/alfred-searchio
f4a14cbe5350b83d6d962aa993abf01f14b60d33
[ "MIT" ]
66
2015-03-14T18:10:36.000Z
2022-03-27T11:33:56.000Z
src/lib/searchio/cli.py
cgxxv/alfred-searchio
f4a14cbe5350b83d6d962aa993abf01f14b60d33
[ "MIT" ]
36
2015-04-12T16:50:17.000Z
2022-03-28T09:53:32.000Z
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2016 Dean Jackson <deanishe@deanishe.net> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2016-03-13 # """searchio <command> [<options>] [<args>...] Alfred 3 workflow to provide search completion suggestions from various search engines i...
24.438849
78
0.585517
"""searchio <command> [<options>] [<args>...] Alfred 3 workflow to provide search completion suggestions from various search engines in various languages. Usage: searchio <command> [<args>...] searchio -h|--version Options: -h, --help Display this help message --version Show ve...
false
true
f710852baef6447333c4f3c0bfd0f7c232311700
368
py
Python
products/urls.py
zerobug110/Syfters_project
3fac21dee2e0ff9dea4efa62e325ca02b4811c5b
[ "MIT" ]
null
null
null
products/urls.py
zerobug110/Syfters_project
3fac21dee2e0ff9dea4efa62e325ca02b4811c5b
[ "MIT" ]
null
null
null
products/urls.py
zerobug110/Syfters_project
3fac21dee2e0ff9dea4efa62e325ca02b4811c5b
[ "MIT" ]
null
null
null
from django.urls import path from . import views urlpatterns = [ path('', views.Home, name="home"), path('portfolio', views.portfolio, name="portfolio"), path('news', views.news, name="new"), path('contacts', views.contacts, name="contacts"), path('about', views.about, name="about"), path('prod...
30.666667
59
0.649457
from django.urls import path from . import views urlpatterns = [ path('', views.Home, name="home"), path('portfolio', views.portfolio, name="portfolio"), path('news', views.news, name="new"), path('contacts', views.contacts, name="contacts"), path('about', views.about, name="about"), path('prod...
true
true
f7108595916ac71d85b22900f9d5e26db9ef5485
167
py
Python
t4proj/apps/survey/templatetags/survey_extra.py
mivanov-utwente/t4proj
78b717dc6e7ab8db6a3fc69cea64a640c050dc5c
[ "BSD-2-Clause" ]
null
null
null
t4proj/apps/survey/templatetags/survey_extra.py
mivanov-utwente/t4proj
78b717dc6e7ab8db6a3fc69cea64a640c050dc5c
[ "BSD-2-Clause" ]
null
null
null
t4proj/apps/survey/templatetags/survey_extra.py
mivanov-utwente/t4proj
78b717dc6e7ab8db6a3fc69cea64a640c050dc5c
[ "BSD-2-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from django import template register = template.Library() @register.filter(name='times') def times(value, arg): return value * int(arg)
16.7
30
0.676647
from django import template register = template.Library() @register.filter(name='times') def times(value, arg): return value * int(arg)
true
true
f71085e653a5d2a7a7371d23a0bed36878d58053
353
py
Python
main.py
manji6/scraping_playstation
8f68dcd862ea6018fea566a271a473ad0226eb4a
[ "MIT" ]
null
null
null
main.py
manji6/scraping_playstation
8f68dcd862ea6018fea566a271a473ad0226eb4a
[ "MIT" ]
null
null
null
main.py
manji6/scraping_playstation
8f68dcd862ea6018fea566a271a473ad0226eb4a
[ "MIT" ]
null
null
null
import os from flask import Flask, jsonify from scraper import Scraper app = Flask(__name__) scraper = Scraper() @app.route("/") def store_playstation(): return jsonify(scraper.store_playstation("https://store.playstation.com/ja-jp/category/1b6c3e7d-4445-4cef-a046-efd94a1085b7/")) if __name__ == "__main__": ...
20.764706
131
0.745042
import os from flask import Flask, jsonify from scraper import Scraper app = Flask(__name__) scraper = Scraper() @app.route("/") def store_playstation(): return jsonify(scraper.store_playstation("https://store.playstation.com/ja-jp/category/1b6c3e7d-4445-4cef-a046-efd94a1085b7/")) if __name__ == "__main__": ...
true
true
f71085ec739d1449547fd29afdf7e03034eab25f
5,960
py
Python
scenario analysis/portfolio_evaluation.py
iamlmn/monte_carlo_analysis
45f7af2b439f80bce429a94257a1167c9d5f4a2c
[ "MIT" ]
null
null
null
scenario analysis/portfolio_evaluation.py
iamlmn/monte_carlo_analysis
45f7af2b439f80bce429a94257a1167c9d5f4a2c
[ "MIT" ]
null
null
null
scenario analysis/portfolio_evaluation.py
iamlmn/monte_carlo_analysis
45f7af2b439f80bce429a94257a1167c9d5f4a2c
[ "MIT" ]
1
2022-03-12T02:43:40.000Z
2022-03-12T02:43:40.000Z
import yfinance import pandas as pd import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm def _simulate_returns(historical_returns,forecast_days): return historical_returns.sample(n = forecast_days, replace = True).reset_index(drop = True) def simulate_modifie...
32.043011
122
0.696477
import yfinance import pandas as pd import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm def _simulate_returns(historical_returns,forecast_days): return historical_returns.sample(n = forecast_days, replace = True).reset_index(drop = True) def simulate_modifie...
true
true
f71086a27c8d2575723b4d063f71368735eda0f7
547
py
Python
WebMirror/management/rss_parser_funcs/feed_parse_extractWriterupdatesCom.py
fake-name/ReadableWebProxy
ed5c7abe38706acc2684a1e6cd80242a03c5f010
[ "BSD-3-Clause" ]
193
2016-08-02T22:04:35.000Z
2022-03-09T20:45:41.000Z
WebMirror/management/rss_parser_funcs/feed_parse_extractWriterupdatesCom.py
fake-name/ReadableWebProxy
ed5c7abe38706acc2684a1e6cd80242a03c5f010
[ "BSD-3-Clause" ]
533
2016-08-23T20:48:23.000Z
2022-03-28T15:55:13.000Z
WebMirror/management/rss_parser_funcs/feed_parse_extractWriterupdatesCom.py
rrosajp/ReadableWebProxy
ed5c7abe38706acc2684a1e6cd80242a03c5f010
[ "BSD-3-Clause" ]
19
2015-08-13T18:01:08.000Z
2021-07-12T17:13:09.000Z
def extractWriterupdatesCom(item): ''' Parser for 'writerupdates.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loiterous', 'Loi...
24.863636
104
0.632541
def extractWriterupdatesCom(item): vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loiterous', 'Loiterous', 'oel'), ] for t...
true
true
f7108744cd51bdd0a03c5f6fc838c34d3a33e864
2,948
py
Python
tests/factors/test_selector.py
eru1030/zvt
8a2cc66a0c24a587cc28b9b7b3df99738c59c684
[ "MIT" ]
6
2021-08-15T10:00:35.000Z
2022-03-14T14:40:46.000Z
tests/factors/test_selector.py
eru1030/zvt
8a2cc66a0c24a587cc28b9b7b3df99738c59c684
[ "MIT" ]
null
null
null
tests/factors/test_selector.py
eru1030/zvt
8a2cc66a0c24a587cc28b9b7b3df99738c59c684
[ "MIT" ]
5
2021-07-18T08:27:37.000Z
2022-03-31T14:10:21.000Z
# -*- coding: utf-8 -*- from zvt.contract import IntervalLevel from zvt.factors.target_selector import TargetSelector from zvt.factors.ma.ma_factor import CrossMaFactor from zvt.factors import BullFactor from ..context import init_test_context init_test_context() class TechnicalSelector(TargetSelector): def init...
38.789474
115
0.623474
from zvt.contract import IntervalLevel from zvt.factors.target_selector import TargetSelector from zvt.factors.ma.ma_factor import CrossMaFactor from zvt.factors import BullFactor from ..context import init_test_context init_test_context() class TechnicalSelector(TargetSelector): def init_factors(self, entity_i...
true
true
f710890c22bca4ab177c69597bdcc56c29460866
1,061
py
Python
unicorn/tests/regress/mips_branch_delay.py
clayne/unicorn_pe
592bed62735d746c910609546c0db00c5771ae01
[ "MIT" ]
491
2019-01-02T02:43:49.000Z
2022-03-29T11:43:07.000Z
unicorn/tests/regress/mips_branch_delay.py
clayne/unicorn_pe
592bed62735d746c910609546c0db00c5771ae01
[ "MIT" ]
29
2019-01-02T03:04:34.000Z
2022-03-23T10:23:58.000Z
unicorn/tests/regress/mips_branch_delay.py
clayne/unicorn_pe
592bed62735d746c910609546c0db00c5771ae01
[ "MIT" ]
161
2019-01-02T03:02:47.000Z
2022-03-03T08:48:53.000Z
#!/usr/bin/python from capstone import * from unicorn import * import regress class MipsBranchDelay(regress.RegressTest): def runTest(self): md = Cs(CS_ARCH_MIPS, CS_MODE_MIPS32 + CS_MODE_LITTLE_ENDIAN) def disas(code, addr): for i in md.disasm(code, addr): print '0x%...
28.675676
107
0.60886
from capstone import * from unicorn import * import regress class MipsBranchDelay(regress.RegressTest): def runTest(self): md = Cs(CS_ARCH_MIPS, CS_MODE_MIPS32 + CS_MODE_LITTLE_ENDIAN) def disas(code, addr): for i in md.disasm(code, addr): print '0x%x: %s %-6s %s' % ...
false
true
f71089cb130f4b31517af470738fe6f309467cf0
4,535
py
Python
tests/plugins/test_docker_api.py
MartinBasti/atomic-reactor
4431225c5a474c7f88c63ec1f25216d4b84a0f1d
[ "BSD-3-Clause" ]
null
null
null
tests/plugins/test_docker_api.py
MartinBasti/atomic-reactor
4431225c5a474c7f88c63ec1f25216d4b84a0f1d
[ "BSD-3-Clause" ]
1
2018-04-25T12:42:14.000Z
2018-04-29T20:31:00.000Z
tests/plugins/test_docker_api.py
MartinBasti/atomic-reactor
4431225c5a474c7f88c63ec1f25216d4b84a0f1d
[ "BSD-3-Clause" ]
null
null
null
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import docker import requests from dockerfile_parse import DockerfileParser from atomic_reactor.pl...
30.641892
77
0.690849
from __future__ import unicode_literals import docker import requests from dockerfile_parse import DockerfileParser from atomic_reactor.plugin import PluginFailedException from atomic_reactor.build import InsideBuilder, BuildResult from atomic_reactor.util import ImageName, CommandResult from atomic_reactor.inner i...
true
true
f7108b18f3cafb6b5f9f52bb095ed18dd1b80111
1,460
py
Python
Parser.py
Abirdcfly/MsohuUrlTest
0226820699067489c6e21099e3b41d8be67ac96f
[ "MIT" ]
null
null
null
Parser.py
Abirdcfly/MsohuUrlTest
0226820699067489c6e21099e3b41d8be67ac96f
[ "MIT" ]
null
null
null
Parser.py
Abirdcfly/MsohuUrlTest
0226820699067489c6e21099e3b41d8be67ac96f
[ "MIT" ]
null
null
null
# !/usr/bin/env python # -*- coding:utf-8 -*- from bs4 import BeautifulSoup import urlparse import re class Parser(object): def _pre_test(self, url, soup): bad_links = {} if soup.title == "手机搜狐" and url != 'http://m.sohu.com': bad_links[url] = 404 # todo:坏链处理。。。 ...
29.795918
80
0.520548
from bs4 import BeautifulSoup import urlparse import re class Parser(object): def _pre_test(self, url, soup): bad_links = {} if soup.title == "手机搜狐" and url != 'http://m.sohu.com': bad_links[url] = 404 return False, bad_links return True, None ...
false
true
f7108f493a2b4e0859207074f20dfc4dc12a43b2
167
py
Python
utils/models/common_models/blocks/__init__.py
voldemortX/DeeplabV3_PyTorch1.3_Codebase
d22d23e74800fafb58eeb61d6649008745c1a287
[ "BSD-3-Clause" ]
1
2020-09-17T06:21:39.000Z
2020-09-17T06:21:39.000Z
utils/models/common_models/blocks/__init__.py
voldemortX/pytorch-segmentation
9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda
[ "BSD-3-Clause" ]
null
null
null
utils/models/common_models/blocks/__init__.py
voldemortX/pytorch-segmentation
9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda
[ "BSD-3-Clause" ]
null
null
null
from .inverted_residual import InvertedResidual, InvertedResidualV3 from .non_bottleneck_1d import non_bottleneck_1d from .dilated_bottleneck import DilatedBottleneck
41.75
67
0.898204
from .inverted_residual import InvertedResidual, InvertedResidualV3 from .non_bottleneck_1d import non_bottleneck_1d from .dilated_bottleneck import DilatedBottleneck
true
true
f7108f52cfbe4b54cdab9073d5746e1107e734cd
2,368
py
Python
pypeerassets/kutil.py
sparklecoin/pypeerassets
51a0597d45dd23768d7f4eb41558400f758020fc
[ "BSD-3-Clause" ]
null
null
null
pypeerassets/kutil.py
sparklecoin/pypeerassets
51a0597d45dd23768d7f4eb41558400f758020fc
[ "BSD-3-Clause" ]
null
null
null
pypeerassets/kutil.py
sparklecoin/pypeerassets
51a0597d45dd23768d7f4eb41558400f758020fc
[ "BSD-3-Clause" ]
null
null
null
from hashlib import sha256 from os import urandom from btcpy.structs.crypto import PublicKey, PrivateKey from btcpy.structs.transaction import MutableTransaction, TxOut from btcpy.structs.sig import P2pkhSolver from pypeerassets.networks import net_query class Kutil: def __init__(self, network: str, privkey: ...
34.823529
84
0.616976
from hashlib import sha256 from os import urandom from btcpy.structs.crypto import PublicKey, PrivateKey from btcpy.structs.transaction import MutableTransaction, TxOut from btcpy.structs.sig import P2pkhSolver from pypeerassets.networks import net_query class Kutil: def __init__(self, network: str, privkey: ...
true
true
f7108f756f946059be6c4f65b83a9a568d67d595
4,743
py
Python
evalie.py
ferhatgec/evalie
caa85312e015df46a75855998adffd3df7df61d2
[ "MIT" ]
1
2022-03-19T13:53:47.000Z
2022-03-19T13:53:47.000Z
evalie.py
ferhatgec/evalie
caa85312e015df46a75855998adffd3df7df61d2
[ "MIT" ]
null
null
null
evalie.py
ferhatgec/evalie
caa85312e015df46a75855998adffd3df7df61d2
[ "MIT" ]
null
null
null
# MIT License # # Copyright (c) 2022 Ferhat Geçdoğan All Rights Reserved. # Distributed under the terms of the MIT License. # # # evalie - a toy evaluator using # shunting-yard algorithm. # ------ # github.com/ferhatgec/evalie # import math class evalie: def __init__(self): self.precedence = { ...
27.736842
102
0.452456
import math class evalie: def __init__(self): self.precedence = { '+': 2, '-': 2, '*': 3, '/': 3, '!': 4, '^': 4, '%': 4 } self.left = 0 self.right = 0 self.op = '' sel...
true
true
f7108fa0fd5d5b3741acce8fdb783ffafa07316b
1,592
py
Python
Scrap11888/lib/DataManagement/Cacher.py
GeorgeVasiliadis/Scrap11888
f485ac894c681489e15c71597b4110859cfc7645
[ "MIT" ]
1
2021-12-14T22:28:43.000Z
2021-12-14T22:28:43.000Z
Scrap11888/lib/DataManagement/Cacher.py
GeorgeVasiliadis/Scrap11888
f485ac894c681489e15c71597b4110859cfc7645
[ "MIT" ]
null
null
null
Scrap11888/lib/DataManagement/Cacher.py
GeorgeVasiliadis/Scrap11888
f485ac894c681489e15c71597b4110859cfc7645
[ "MIT" ]
null
null
null
import os import pickle from .Utils import purify, staticPath def cacheIn(dir, name, data): """ Store given `data` under ./cache/dir/name.pickle file. Note that `dir` and `name` are "purified" before used! -dir: string of sub-directory to be created. Cache-file will be stored in it. It should...
27.929825
81
0.641332
import os import pickle from .Utils import purify, staticPath def cacheIn(dir, name, data): path = staticPath(__file__, "cache") dir = purify(dir) name = purify(name) path = os.path.join(path, dir) os.makedirs(path, exist_ok=True) filename = name + ".pickle" path = os.path.join(pat...
true
true
f7108fcbde1f439374e9925f785ce0a7eab9e618
2,076
py
Python
website_cloner/website_cloner.py
tre3x/awesomeScripts
e70cd64eff7791cfac05f069fb9f7037c1bf05bf
[ "MIT" ]
245
2020-09-24T03:49:20.000Z
2021-01-31T20:09:57.000Z
website_cloner/website_cloner.py
tre3x/awesomeScripts
e70cd64eff7791cfac05f069fb9f7037c1bf05bf
[ "MIT" ]
252
2020-09-28T02:19:44.000Z
2021-01-23T09:00:34.000Z
website_cloner/website_cloner.py
tre3x/awesomeScripts
e70cd64eff7791cfac05f069fb9f7037c1bf05bf
[ "MIT" ]
219
2020-09-23T18:51:42.000Z
2021-01-23T09:54:40.000Z
"""" Program name : Website cloner author : https://github.com/codeperfectplus How to use : Check README.md """ import os import sys import requests from bs4 import BeautifulSoup class CloneWebsite: def __init__(self, website_name): self.website_name = website_name def crawl_website(sel...
29.239437
79
0.560694
import os import sys import requests from bs4 import BeautifulSoup class CloneWebsite: def __init__(self, website_name): self.website_name = website_name def crawl_website(self): content = requests.get(website_name) if content.status_code == 200: return content def c...
true
true
f7108fee8a89713ce266ef09bd13226718600bc7
7,474
py
Python
tfx/orchestration/portable/python_executor_operator_test.py
rtg0795/tfx
63c31b719896eef645df3850d0e6b946e44cd059
[ "Apache-2.0" ]
null
null
null
tfx/orchestration/portable/python_executor_operator_test.py
rtg0795/tfx
63c31b719896eef645df3850d0e6b946e44cd059
[ "Apache-2.0" ]
null
null
null
tfx/orchestration/portable/python_executor_operator_test.py
rtg0795/tfx
63c31b719896eef645df3850d0e6b946e44cd059
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Google LLC. All Rights Reserved. # # 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 a...
37.18408
98
0.677816
import os from typing import Any, Dict, List import tensorflow as tf from tfx import types from tfx.dsl.components.base import base_executor from tfx.dsl.io import fileio from tfx.orchestration.portable import data_types from tfx.orchestration.portable import outputs_utils from tfx.orchestration.portable...
true
true
f71092382f306099163685134981cd5673eeb335
3,980
py
Python
visualisation/drift_paper/plot_ohc_drift.py
DamienIrving/ocean-analysis
23a6dbf616fb84e6e158e32534ffd394e0df2e3e
[ "MIT" ]
7
2017-06-06T20:20:58.000Z
2020-02-05T23:28:41.000Z
visualisation/drift_paper/plot_ohc_drift.py
DamienIrving/ocean-analysis
23a6dbf616fb84e6e158e32534ffd394e0df2e3e
[ "MIT" ]
17
2017-04-06T04:46:37.000Z
2021-07-01T00:47:50.000Z
visualisation/drift_paper/plot_ohc_drift.py
DamienIrving/ocean-analysis
23a6dbf616fb84e6e158e32534ffd394e0df2e3e
[ "MIT" ]
4
2021-01-19T01:31:40.000Z
2022-03-15T00:50:11.000Z
""" Filename: plot_ohc_drift.py Author: Damien Irving, irving.damien@gmail.com Description: Create a bar chart showing drift in ocean heat content and its thermal and barystatic components """ # Import general Python modules import sys import os import re import pdb import argparse import...
33.728814
113
0.634422
import sys import os import re import pdb import argparse import numpy as np import pandas as pd import matplotlib.pyplot as plt import cmdline_provenance as cmdprov cwd = os.getcwd() repo_dir = '/' for directory in cwd.split('/')[1:]: repo_dir = os.path.join(repo_dir, directory) if directory == 'ocean-an...
true
true
f710927746bde172fc3423890b8ea4a1489a2714
8,943
py
Python
gui.py
FengZiYjun/Secret-Chat
8b77afa0d90ad400cf3d2965626f56df5f7cc6d4
[ "Apache-2.0" ]
3
2019-04-10T03:37:30.000Z
2020-05-19T18:23:48.000Z
gui.py
FengZiYjun/Secret-Words
8b77afa0d90ad400cf3d2965626f56df5f7cc6d4
[ "Apache-2.0" ]
1
2021-05-03T19:59:02.000Z
2021-05-03T19:59:02.000Z
gui.py
FengZiYjun/Secret-Words
8b77afa0d90ad400cf3d2965626f56df5f7cc6d4
[ "Apache-2.0" ]
1
2020-03-04T06:09:41.000Z
2020-03-04T06:09:41.000Z
import tkinter as tk import threading from tkinter import scrolledtext from tkinter import messagebox ENCODING = 'utf-8' class GUI(threading.Thread): def __init__(self, client): super().__init__(daemon=False, target=self.run) self.font = ('Helvetica', 13) self.client = client self...
35.772
95
0.620933
import tkinter as tk import threading from tkinter import scrolledtext from tkinter import messagebox ENCODING = 'utf-8' class GUI(threading.Thread): def __init__(self, client): super().__init__(daemon=False, target=self.run) self.font = ('Helvetica', 13) self.client = client self...
true
true
f71093e41ef3731d1456d1c31f98330463d1f376
1,613
py
Python
whoahqa/views/request_methods.py
onaio/who-adolescent-hqa
108a7e60b025d0723247f5f02eab2c4d41f5a02a
[ "Apache-2.0" ]
null
null
null
whoahqa/views/request_methods.py
onaio/who-adolescent-hqa
108a7e60b025d0723247f5f02eab2c4d41f5a02a
[ "Apache-2.0" ]
2
2018-01-09T08:58:11.000Z
2019-01-18T09:20:14.000Z
whoahqa/views/request_methods.py
onaio/who-adolescent-hqa
108a7e60b025d0723247f5f02eab2c4d41f5a02a
[ "Apache-2.0" ]
null
null
null
from sqlalchemy.orm.exc import NoResultFound from whoahqa.models import ( ClinicFactory, User, ) from whoahqa.constants import groups from whoahqa.constants import permissions as perms def get_request_user(request): user_id = request.authenticated_userid try: return User.get(User.id == user_...
23.720588
59
0.66708
from sqlalchemy.orm.exc import NoResultFound from whoahqa.models import ( ClinicFactory, User, ) from whoahqa.constants import groups from whoahqa.constants import permissions as perms def get_request_user(request): user_id = request.authenticated_userid try: return User.get(User.id == user_...
true
true
f71094846216537592d2d28a0f6ffcbe78b79a5d
684
py
Python
goals/finance_goal/migrations/0001_initial.py
hornd/django-finance
40647a00509f5f0aa651af86c3b6f11730228041
[ "Apache-2.0" ]
null
null
null
goals/finance_goal/migrations/0001_initial.py
hornd/django-finance
40647a00509f5f0aa651af86c3b6f11730228041
[ "Apache-2.0" ]
null
null
null
goals/finance_goal/migrations/0001_initial.py
hornd/django-finance
40647a00509f5f0aa651af86c3b6f11730228041
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-11 01:18 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Goal', ...
26.307692
114
0.587719
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Goal', fields=[ ('id', models.AutoField(auto_crea...
true
true
f710949d97ae83f867dbea8919f8385218e938f6
501
py
Python
Multiplication.py
13472889991/DataStructures-Algorithms
3eb219460f0f8108bb3c07c4de5544df412e189e
[ "MIT" ]
null
null
null
Multiplication.py
13472889991/DataStructures-Algorithms
3eb219460f0f8108bb3c07c4de5544df412e189e
[ "MIT" ]
null
null
null
Multiplication.py
13472889991/DataStructures-Algorithms
3eb219460f0f8108bb3c07c4de5544df412e189e
[ "MIT" ]
null
null
null
from math import ceil def karatsuba(a,b): if a < 10 and b < 10: return a*b n = max(len(str(a)), len(str(b))) m = int(ceil(float(n)/2)) a1 = int(a // 10**m) a2 = int(a % (10**m)) b1 = int(b // 10**m) b2 = int(b % (10**m)) ...
19.269231
45
0.373253
from math import ceil def karatsuba(a,b): if a < 10 and b < 10: return a*b n = max(len(str(a)), len(str(b))) m = int(ceil(float(n)/2)) a1 = int(a // 10**m) a2 = int(a % (10**m)) b1 = int(b // 10**m) b2 = int(b % (10**m)) ...
true
true
f710978296da5c053d75a954fe654c6f36c7a147
518
py
Python
social_core/backends/withings.py
astofsel/package_2
149672d16048a1f0d4b158379432034f0234e168
[ "BSD-3-Clause" ]
1
2017-03-05T01:43:57.000Z
2017-03-05T01:43:57.000Z
social_core/backends/withings.py
astofsel/package_2
149672d16048a1f0d4b158379432034f0234e168
[ "BSD-3-Clause" ]
2
2022-02-10T16:51:56.000Z
2022-02-10T18:23:52.000Z
social_core/backends/withings.py
astofsel/package_2
149672d16048a1f0d4b158379432034f0234e168
[ "BSD-3-Clause" ]
null
null
null
from .oauth import BaseOAuth1 class WithingsOAuth(BaseOAuth1): name = 'withings' AUTHORIZATION_URL = 'https://oauth.withings.com/account/authorize' REQUEST_TOKEN_URL = 'https://oauth.withings.com/account/request_token' ACCESS_TOKEN_URL = 'https://oauth.withings.com/account/access_token' ID_KEY = '...
34.533333
74
0.685328
from .oauth import BaseOAuth1 class WithingsOAuth(BaseOAuth1): name = 'withings' AUTHORIZATION_URL = 'https://oauth.withings.com/account/authorize' REQUEST_TOKEN_URL = 'https://oauth.withings.com/account/request_token' ACCESS_TOKEN_URL = 'https://oauth.withings.com/account/access_token' ID_KEY = '...
true
true
f7109950a5b343a22646337789e00f664d4489bb
53,193
py
Python
heat/tests/engine/test_scheduler.py
larsks/heat
11064586e90166a037f8868835e6ce36f7306276
[ "Apache-2.0" ]
null
null
null
heat/tests/engine/test_scheduler.py
larsks/heat
11064586e90166a037f8868835e6ce36f7306276
[ "Apache-2.0" ]
null
null
null
heat/tests/engine/test_scheduler.py
larsks/heat
11064586e90166a037f8868835e6ce36f7306276
[ "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 # ...
30.103565
79
0.579531
import contextlib import itertools import eventlet import six from heat.common.i18n import repr_wrapper from heat.common import timeutils from heat.engine import dependencies from heat.engine import scheduler from heat.tests import common class DummyTask(object): def __init__(self, num_steps=3, del...
true
true
f7109b54b5906c81389c8ba2757f70f271fff476
1,249
py
Python
examples/servers_by_group.py
mphbig/cyberwatch_api_toolbox
26058b0e25aea11b3e2d49efe5ad713db7164dc4
[ "MIT" ]
null
null
null
examples/servers_by_group.py
mphbig/cyberwatch_api_toolbox
26058b0e25aea11b3e2d49efe5ad713db7164dc4
[ "MIT" ]
null
null
null
examples/servers_by_group.py
mphbig/cyberwatch_api_toolbox
26058b0e25aea11b3e2d49efe5ad713db7164dc4
[ "MIT" ]
null
null
null
"""Example: Find all servers per group""" import os from configparser import ConfigParser from cbw_api_toolbox.cbw_api import CBWApi CONF = ConfigParser() CONF.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'api.conf')) CLIENT = CBWApi(CONF.get('cyberwatch', 'url'), CONF.get('cyberwatch', 'api_ke...
31.225
119
0.689351
import os from configparser import ConfigParser from cbw_api_toolbox.cbw_api import CBWApi CONF = ConfigParser() CONF.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'api.conf')) CLIENT = CBWApi(CONF.get('cyberwatch', 'url'), CONF.get('cyberwatch', 'api_key'), CONF.get('cyberwatch', 'secret_key'))...
true
true
f7109b8dd0c34cf93c9e4fe141288fdbca2bd1bc
1,541
py
Python
tests/integration/goldens/logging/samples/generated_samples/logging_generated_logging_v2_config_service_v2_get_cmek_settings_sync.py
atulep/gapic-generator-python
ea6cfe6d6a4276894dba9b4a2efe458df86a08a0
[ "Apache-2.0" ]
null
null
null
tests/integration/goldens/logging/samples/generated_samples/logging_generated_logging_v2_config_service_v2_get_cmek_settings_sync.py
atulep/gapic-generator-python
ea6cfe6d6a4276894dba9b4a2efe458df86a08a0
[ "Apache-2.0" ]
null
null
null
tests/integration/goldens/logging/samples/generated_samples/logging_generated_logging_v2_config_service_v2_get_cmek_settings_sync.py
atulep/gapic-generator-python
ea6cfe6d6a4276894dba9b4a2efe458df86a08a0
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
31.44898
85
0.757949
from google.cloud import logging_v2 def sample_get_cmek_settings(): client = logging_v2.ConfigServiceV2Client() project = "my-project-id" name = f"projects/{project}/cmekSettings" request = logging_v2.GetCmekSettingsRequest( name=name, ) resp...
true
true
f7109beea6f6b9d5cc94d3efdcd05188c671498a
6,705
py
Python
bindings/python/ensmallen_graph/datasets/string/azotobactervinelandii.py
caufieldjh/ensmallen_graph
14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a
[ "MIT" ]
null
null
null
bindings/python/ensmallen_graph/datasets/string/azotobactervinelandii.py
caufieldjh/ensmallen_graph
14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a
[ "MIT" ]
null
null
null
bindings/python/ensmallen_graph/datasets/string/azotobactervinelandii.py
caufieldjh/ensmallen_graph
14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a
[ "MIT" ]
null
null
null
""" This file offers the methods to automatically retrieve the graph Azotobacter vinelandii. The graph is automatically retrieved from the STRING repository. Report --------------------- At the time of rendering these methods (please see datetime below), the graph had the following characteristics: Datetime: 2021...
35.47619
223
0.704549
from typing import Dict from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph from ...ensmallen_graph import EnsmallenGraph def AzotobacterVinelandii( directed: bool = False, verbose: int = 2, cache_path: str = "graphs/string", **additional_graph_kwargs: Dict ) -> EnsmallenGraph: ...
true
true
f7109c9004fba9b86d167445229f2126cfcf0b42
295
py
Python
movies/urls.py
huseyinyilmaz/django-movie-search
29a989eb04d46319a7218daf776b8a0ec831845b
[ "MIT" ]
null
null
null
movies/urls.py
huseyinyilmaz/django-movie-search
29a989eb04d46319a7218daf776b8a0ec831845b
[ "MIT" ]
null
null
null
movies/urls.py
huseyinyilmaz/django-movie-search
29a989eb04d46319a7218daf776b8a0ec831845b
[ "MIT" ]
null
null
null
from django.conf.urls import url from movies import views urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='movies-index'), url(r'^name/$', views.NameSearchView.as_view(), name='movies-name-search'), url(r'^id/$', views.IDSearchView.as_view(), name='movies-id-search'), ]
32.777778
79
0.681356
from django.conf.urls import url from movies import views urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='movies-index'), url(r'^name/$', views.NameSearchView.as_view(), name='movies-name-search'), url(r'^id/$', views.IDSearchView.as_view(), name='movies-id-search'), ]
true
true
f7109ced9584331781ae4dbeffdd97a368c81513
65,460
py
Python
elevenclock/__init__.py
wanderleihuttel/ElevenClock
de4272a650111233acf36c909c7e269c8dc810d2
[ "Apache-2.0" ]
null
null
null
elevenclock/__init__.py
wanderleihuttel/ElevenClock
de4272a650111233acf36c909c7e269c8dc810d2
[ "Apache-2.0" ]
null
null
null
elevenclock/__init__.py
wanderleihuttel/ElevenClock
de4272a650111233acf36c909c7e269c8dc810d2
[ "Apache-2.0" ]
null
null
null
try: import time FirstTime = time.time() import os import io import sys import time import glob import socket import locale import hashlib import tempfile import datetime import subprocess from ctypes import windll from urllib.request import urlopen try...
50.981308
324
0.557195
try: import time FirstTime = time.time() import os import io import sys import time import glob import socket import locale import hashlib import tempfile import datetime import subprocess from ctypes import windll from urllib.request import urlopen try...
true
true
f7109ddb17e4780f3af2f2375fee8cd66928aded
1,069
py
Python
Chapter03/scrapelxml.py
elephantscale/Hands-On-Web-Scraping-with-Python
013069a23c5bc3846ab475c5774bc6ff9a27c348
[ "MIT" ]
43
2019-03-05T12:37:35.000Z
2022-01-24T11:43:37.000Z
Chapter03/scrapelxml.py
elephantscale/Hands-On-Web-Scraping-with-Python
013069a23c5bc3846ab475c5774bc6ff9a27c348
[ "MIT" ]
1
2019-12-29T10:34:13.000Z
2020-08-10T07:19:28.000Z
Chapter03/scrapelxml.py
elephantscale/Hands-On-Web-Scraping-with-Python
013069a23c5bc3846ab475c5774bc6ff9a27c348
[ "MIT" ]
42
2019-05-02T10:28:35.000Z
2022-02-16T16:45:48.000Z
import lxml.html musicUrl= "http://books.toscrape.com/catalogue/category/books/music_14/index.html" doc = lxml.html.parse(musicUrl) #base element articles = doc.xpath("//*[@id='default']/div/div/div/div/section/div[2]/ol/li[1]/article")[0] #individual element inside base title = articles.xpath("//h3/a/text()") pri...
35.633333
105
0.715622
import lxml.html musicUrl= "http://books.toscrape.com/catalogue/category/books/music_14/index.html" doc = lxml.html.parse(musicUrl) articles = doc.xpath("//*[@id='default']/div/div/div/div/section/div[2]/ol/li[1]/article")[0] title = articles.xpath("//h3/a/text()") price = articles.xpath("//div[2]/p[contains(@cl...
true
true
f7109e2a81729843d72c0ff010349421f9434137
3,018
py
Python
sdk/monitor/azure-monitor-query/setup.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
1
2021-09-16T02:33:52.000Z
2021-09-16T02:33:52.000Z
sdk/monitor/azure-monitor-query/setup.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
1
2019-08-05T19:14:28.000Z
2019-08-05T19:30:05.000Z
sdk/monitor/azure-monitor-query/setup.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
1
2016-04-19T22:15:47.000Z
2016-04-19T22:15:47.000Z
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
33.164835
85
0.60603
import re import os.path from io import open from setuptools import find_packages, setup PACKAGE_NAME = "azure-monitor-query" PACKAGE_PPRINT_NAME = "Azure Monitor Query" package_folder_path = PACKAGE_NAME.replace('-', '/') namespace_name = PACKAGE_NAME.replace('-', '.') try: import azure try: ...
true
true
f7109e5f329e34712969175bcdd6c832599f7ef5
1,218
py
Python
mandala/tests/test_call_graph.py
amakelov/mandala
a9ec051ef730ada4eed216c62a07b033126e78d5
[ "Apache-2.0" ]
9
2022-02-22T19:24:01.000Z
2022-03-23T04:46:41.000Z
mandala/tests/test_call_graph.py
amakelov/mandala
a9ec051ef730ada4eed216c62a07b033126e78d5
[ "Apache-2.0" ]
null
null
null
mandala/tests/test_call_graph.py
amakelov/mandala
a9ec051ef730ada4eed216c62a07b033126e78d5
[ "Apache-2.0" ]
null
null
null
from .utils import * from .funcs import * def test_unit(): storage = Storage() @op(storage) def f(x:int) -> int: return x + 1 @superop(storage) def f_twice(x:int) -> int: return f(f(x)) with run(storage, autocommit=True): f_twice(42) cg = storage.cal...
24.857143
85
0.587028
from .utils import * from .funcs import * def test_unit(): storage = Storage() @op(storage) def f(x:int) -> int: return x + 1 @superop(storage) def f_twice(x:int) -> int: return f(f(x)) with run(storage, autocommit=True): f_twice(42) cg = storage.cal...
true
true
f7109e8ff05634250514692e37d4f0e4532aeadd
364
py
Python
tests/conanbuilder/test_remote.py
arnaudgelas/mumoco
f38db5bdccc93473e2b8bfeb8e7f2884063fd9de
[ "MIT" ]
null
null
null
tests/conanbuilder/test_remote.py
arnaudgelas/mumoco
f38db5bdccc93473e2b8bfeb8e7f2884063fd9de
[ "MIT" ]
null
null
null
tests/conanbuilder/test_remote.py
arnaudgelas/mumoco
f38db5bdccc93473e2b8bfeb8e7f2884063fd9de
[ "MIT" ]
null
null
null
import pytest from src.conanbuilder.remote import Remote @pytest.fixture def remote(): return Remote("myName", "myUrl") def test_default_values(remote): assert remote.name == "myName" assert remote.url == "myUrl" assert remote.verify_ssl is True assert remote.priority == 0 assert remote.forc...
21.411765
42
0.717033
import pytest from src.conanbuilder.remote import Remote @pytest.fixture def remote(): return Remote("myName", "myUrl") def test_default_values(remote): assert remote.name == "myName" assert remote.url == "myUrl" assert remote.verify_ssl is True assert remote.priority == 0 assert remote.forc...
true
true
f7109ec47cb12c07cbd7c2c04ebf2dc466ee9099
423
py
Python
commons/templatetags/common_tags.py
lsalta/mapground
d927d283dab6f756574bd88b3251b9e68f000ca7
[ "MIT" ]
null
null
null
commons/templatetags/common_tags.py
lsalta/mapground
d927d283dab6f756574bd88b3251b9e68f000ca7
[ "MIT" ]
3
2020-02-11T23:04:56.000Z
2021-06-10T18:07:53.000Z
commons/templatetags/common_tags.py
lsalta/mapground
d927d283dab6f756574bd88b3251b9e68f000ca7
[ "MIT" ]
1
2021-08-20T14:49:09.000Z
2021-08-20T14:49:09.000Z
from django import template from django.conf import settings from django.utils.safestring import mark_safe register = template.Library() # settings value @register.simple_tag def settings_value(name): defaults = { 'SITE_HEADER': '<b>Map</b>Ground', 'SITE_TITLE': 'MapGround' } if name in d...
22.263158
65
0.680851
from django import template from django.conf import settings from django.utils.safestring import mark_safe register = template.Library() @register.simple_tag def settings_value(name): defaults = { 'SITE_HEADER': '<b>Map</b>Ground', 'SITE_TITLE': 'MapGround' } if name in defaults: ...
true
true
f7109ecc06eaa292a20f8a9fb4dbb062ffca45f0
610
py
Python
scripts/emnist_viz_tf.py
vipavlovic/pyprobml
59a2edc682d0163955db5e2f27491ad772b60141
[ "MIT" ]
4,895
2016-08-17T22:28:34.000Z
2022-03-31T17:07:15.000Z
scripts/emnist_viz_tf.py
vipavlovic/pyprobml
59a2edc682d0163955db5e2f27491ad772b60141
[ "MIT" ]
446
2016-09-17T14:35:29.000Z
2022-03-31T19:59:33.000Z
scripts/emnist_viz_tf.py
vipavlovic/pyprobml
59a2edc682d0163955db5e2f27491ad772b60141
[ "MIT" ]
1,160
2016-08-18T23:19:27.000Z
2022-03-31T12:44:07.000Z
import superimport import numpy as np import matplotlib.pyplot as plt import pyprobml_utils as pml import tensorflow as tf import tensorflow_datasets as tfds np.random.seed(0) ds, info = tfds.load('emnist', split='test', shuffle_files=False, with_info=True) # horribly slow print(info) plt.figure(figsize=(10, 1...
17.941176
97
0.67541
import superimport import numpy as np import matplotlib.pyplot as plt import pyprobml_utils as pml import tensorflow as tf import tensorflow_datasets as tfds np.random.seed(0) ds, info = tfds.load('emnist', split='test', shuffle_files=False, with_info=True) print(info) plt.figure(figsize=(10, 10)) i = 0 for e...
true
true
f7109fd83a9537b7def6232027ba5416b1f71200
1,156
py
Python
scraper/storage_spiders/lingovn.py
chongiadung/choinho
d2a216fe7a5064d73cdee3e928a7beef7f511fd1
[ "MIT" ]
null
null
null
scraper/storage_spiders/lingovn.py
chongiadung/choinho
d2a216fe7a5064d73cdee3e928a7beef7f511fd1
[ "MIT" ]
10
2020-02-11T23:34:28.000Z
2022-03-11T23:16:12.000Z
scraper/storage_spiders/lingovn.py
chongiadung/choinho
d2a216fe7a5064d73cdee3e928a7beef7f511fd1
[ "MIT" ]
3
2018-08-05T14:54:25.000Z
2021-06-07T01:49:59.000Z
# Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//h1[@itemprop='name']", 'price' : "//div[@class='div-new-price']/span[@class='new-price']", 'category' : "//span[@class='item']/a...
38.533333
93
0.614187
from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//h1[@itemprop='name']", 'price' : "//div[@class='div-new-price']/span[@class='new-price']", 'category' : "//span[@class='item']/a[@itemprop='url']/span[@itemprop='title']", 'description' : "//div[@clas...
true
true
f710a02aacb223fde4921f89cbd938a26a27feb5
24,506
py
Python
src/Interpolator.py
MatthiasDR96/industrial_robotics_simulator
9039e7a581ce97c583c73294e9937664de90530b
[ "MIT" ]
1
2020-10-21T15:32:41.000Z
2020-10-21T15:32:41.000Z
src/Interpolator.py
MatthiasDR96/industrial_robotics_simulator
9039e7a581ce97c583c73294e9937664de90530b
[ "MIT" ]
null
null
null
src/Interpolator.py
MatthiasDR96/industrial_robotics_simulator
9039e7a581ce97c583c73294e9937664de90530b
[ "MIT" ]
null
null
null
import numpy as np from sympy import * def interpolate_cubic(p1, p2, k_traj, t): ''' Computes a smooth cubic polynomail between 2 N-dimensional points Input: p1: Nx1 numpy array the first point p2: Nx1 numpy array the second point ...
39.08453
118
0.548437
import numpy as np from sympy import * def interpolate_cubic(p1, p2, k_traj, t): assert type(p1) == np.ndarray and type(p2) == np.ndarray assert type(k_traj) == int and (type(t) == float or type(t) == int) traj_list = [] dtraj_list = [] ddtraj_list = [] dddtraj_list = [] s, ds, dds, ddds...
true
true
f710a0470414947a43cf7b958d2cdc1f201c32b2
1,346
py
Python
model/NoobSender.py
adhocmaster/netmad
fe6c115d71ebeb8c689cdd1b8bed80ac35757681
[ "MIT" ]
null
null
null
model/NoobSender.py
adhocmaster/netmad
fe6c115d71ebeb8c689cdd1b8bed80ac35757681
[ "MIT" ]
null
null
null
model/NoobSender.py
adhocmaster/netmad
fe6c115d71ebeb8c689cdd1b8bed80ac35757681
[ "MIT" ]
null
null
null
from model.Sender import Sender from model.SenderType import SenderType import logging import math import numpy as np class NoobSender(Sender): def __init__(self, id, deliveryRate, debug=True): super().__init__(id, SenderType.Noob, deliveryRate=deliveryRate, debug=debug) def getNumberOfPacketsToCreat...
28.041667
104
0.601783
from model.Sender import Sender from model.SenderType import SenderType import logging import math import numpy as np class NoobSender(Sender): def __init__(self, id, deliveryRate, debug=True): super().__init__(id, SenderType.Noob, deliveryRate=deliveryRate, debug=debug) def getNumberOfPacketsToCreat...
true
true
f710a0c8b136ab0cad55d6b46cb18b57d9494789
3,849
py
Python
customer_selection_line.py
pgmoka/checkout-simulator
bce7e68ba47b9309f19514a9199d43bdbbbc4ffc
[ "MIT" ]
null
null
null
customer_selection_line.py
pgmoka/checkout-simulator
bce7e68ba47b9309f19514a9199d43bdbbbc4ffc
[ "MIT" ]
null
null
null
customer_selection_line.py
pgmoka/checkout-simulator
bce7e68ba47b9309f19514a9199d43bdbbbc4ffc
[ "MIT" ]
null
null
null
''' ----------------------------------------------------------------------- Additional Documentation Made by Zachary A Brader, Kieran Coito, Pedro Goncalves Mokarzel while attending University of Washington Bothell Made in 03/09/2020 Based on instruction in CSS 458, taught by professor Johnny Li...
32.897436
99
0.590543
import numpy as np import random as r import matplotlib.pyplot as plt import variables as v from cashier import cashier from customer import customer from equal_distribution_line import equal_distribution_line class customer_selection_line(equal_distribution_line): customer_list = 0 ...
true
true
f710a1a8fb11a894a1f5202c9c336a54b665cf25
475
py
Python
commons_util/logger/logger_factory.py
zhangdanyangg/commons-util-py
65514ac1f5002b6156a31c09aeb38538a4d88cba
[ "Apache-2.0" ]
7
2015-04-17T02:12:32.000Z
2018-08-08T01:29:24.000Z
commons_util/logger/logger_factory.py
zhangdanyangg/commons-util-py
65514ac1f5002b6156a31c09aeb38538a4d88cba
[ "Apache-2.0" ]
3
2015-05-10T12:18:59.000Z
2016-05-27T06:56:40.000Z
commons_util/logger/logger_factory.py
zhangdanyangg/commons-util-py
65514ac1f5002b6156a31c09aeb38538a4d88cba
[ "Apache-2.0" ]
4
2017-08-26T11:44:20.000Z
2021-06-13T11:50:11.000Z
__author__ = 'Danyang' import logging import sys class LoggerFactory(object): def getConsoleLogger(self, cls_name, level=logging.DEBUG): lgr = logging.getLogger(cls_name) lgr.setLevel(level) if not lgr.handlers: ch = logging.StreamHandler(sys.stdout) ch.setLevel(leve...
33.928571
102
0.633684
__author__ = 'Danyang' import logging import sys class LoggerFactory(object): def getConsoleLogger(self, cls_name, level=logging.DEBUG): lgr = logging.getLogger(cls_name) lgr.setLevel(level) if not lgr.handlers: ch = logging.StreamHandler(sys.stdout) ch.setLevel(leve...
true
true
f710a1c9df18743b2b56aa63b97b0a1180919b20
381
py
Python
src/etl/common/timehelpers.py
vatdaell/spotify-analysis
030239ba16cfc4a80d4f870686450c1ababc62c2
[ "MIT" ]
1
2020-10-14T10:01:37.000Z
2020-10-14T10:01:37.000Z
src/etl/common/timehelpers.py
vatdaell/spotify-analysis
030239ba16cfc4a80d4f870686450c1ababc62c2
[ "MIT" ]
null
null
null
src/etl/common/timehelpers.py
vatdaell/spotify-analysis
030239ba16cfc4a80d4f870686450c1ababc62c2
[ "MIT" ]
null
null
null
from datetime import datetime import datetime def yesterday(today=datetime.datetime.now()): yesterday = today - datetime.timedelta(days=1) yesterday_timestamp = int(yesterday.timestamp()) * 1000 return yesterday_timestamp def extractDate(name, prefix, fileType): prefixLen = len(prefix) fileTypeL...
25.4
59
0.745407
from datetime import datetime import datetime def yesterday(today=datetime.datetime.now()): yesterday = today - datetime.timedelta(days=1) yesterday_timestamp = int(yesterday.timestamp()) * 1000 return yesterday_timestamp def extractDate(name, prefix, fileType): prefixLen = len(prefix) fileTypeL...
true
true
f710a1f1b101dea4375a6417f55a26a8ac830bb1
11,358
py
Python
steampak/libsteam/resources/apps.py
idlesign/steampak
cb3f2c737e272b0360802d947e388df7e34f50f3
[ "BSD-3-Clause" ]
24
2015-08-15T18:41:58.000Z
2021-06-13T13:52:50.000Z
steampak/libsteam/resources/apps.py
idlesign/steampak
cb3f2c737e272b0360802d947e388df7e34f50f3
[ "BSD-3-Clause" ]
3
2016-10-12T13:46:07.000Z
2017-03-05T02:54:22.000Z
steampak/libsteam/resources/apps.py
idlesign/steampak
cb3f2c737e272b0360802d947e388df7e34f50f3
[ "BSD-3-Clause" ]
3
2016-10-12T12:09:43.000Z
2017-03-04T15:49:53.000Z
from datetime import datetime from ctyped.types import CRef from .base import _ApiResourceBase from .stats import CurrentApplicationAchievements from .user import User class Application(_ApiResourceBase): """Exposes methods to get application data. Aliased as ``steampak.SteamApplication``. .. code-bloc...
24.799127
111
0.606797
from datetime import datetime from ctyped.types import CRef from .base import _ApiResourceBase from .stats import CurrentApplicationAchievements from .user import User class Application(_ApiResourceBase): def __init__(self, app_id, *args, **kwargs): client = self.get_client() self._iface = clie...
true
true
f710a2d342bc67d94ff613cd5441efe6e131d4b5
1,087
py
Python
Generators/people.py
DSNR/snippets
12006dd083be60c6444d8b5ca48fd917005e081b
[ "MIT" ]
null
null
null
Generators/people.py
DSNR/snippets
12006dd083be60c6444d8b5ca48fd917005e081b
[ "MIT" ]
null
null
null
Generators/people.py
DSNR/snippets
12006dd083be60c6444d8b5ca48fd917005e081b
[ "MIT" ]
null
null
null
import mem_profile import random import time names = ['John', 'Corey', 'Adam', 'Steve', 'Rick', 'Thomas'] majors = ['Math', 'Engineering', 'CompSci', 'Arts', 'Business'] print 'Memory (Before): {}Mb'.format(mem_profile.memory_usage_psutil()) def people_list(num_people): result = [] for i in xrange...
27.871795
72
0.546458
import mem_profile import random import time names = ['John', 'Corey', 'Adam', 'Steve', 'Rick', 'Thomas'] majors = ['Math', 'Engineering', 'CompSci', 'Arts', 'Business'] print 'Memory (Before): {}Mb'.format(mem_profile.memory_usage_psutil()) def people_list(num_people): result = [] for i in xrange...
false
true
f710a363b900ea04622cbff2e29a0c3ee6a7036c
44,133
py
Python
jupytext/cli.py
sdrees/jupytext
3b1eaa21d3d139444bdc278a0b696c363838e085
[ "MIT" ]
11
2018-06-15T12:12:11.000Z
2018-08-25T14:01:52.000Z
jupytext/cli.py
sdrees/jupytext
3b1eaa21d3d139444bdc278a0b696c363838e085
[ "MIT" ]
33
2018-06-17T01:16:10.000Z
2018-08-30T16:09:02.000Z
jupytext/cli.py
sdrees/jupytext
3b1eaa21d3d139444bdc278a0b696c363838e085
[ "MIT" ]
1
2018-07-20T06:52:12.000Z
2018-07-20T06:52:12.000Z
"""`jupytext` as a command line tool""" import argparse import glob import json import os import re import shlex import subprocess import sys import warnings from copy import copy from tempfile import NamedTemporaryFile from .combine import combine_inputs_with_outputs from .compare import NotebookDifference, compare,...
35.448193
114
0.580246
import argparse import glob import json import os import re import shlex import subprocess import sys import warnings from copy import copy from tempfile import NamedTemporaryFile from .combine import combine_inputs_with_outputs from .compare import NotebookDifference, compare, test_round_trip_conversion from .config...
true
true
f710a3e5b600a82151ff00b430ce32b511a15cd8
3,363
py
Python
spencer/settings.py
AJMansfield/Spencer-Bot
6955e2dec78ebde4c01ed9f637040c4226ec14d0
[ "Apache-2.0" ]
null
null
null
spencer/settings.py
AJMansfield/Spencer-Bot
6955e2dec78ebde4c01ed9f637040c4226ec14d0
[ "Apache-2.0" ]
null
null
null
spencer/settings.py
AJMansfield/Spencer-Bot
6955e2dec78ebde4c01ed9f637040c4226ec14d0
[ "Apache-2.0" ]
null
null
null
""" Django settings for spencer project. Generated by 'django-admin startproject' using Django 3.2.8. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib...
25.671756
91
0.691347
from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-#-js))k7nx&)biw-=pso3u*o%&w@_wngqw0kq1l3ckhh5(52s@' DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contr...
true
true
f710a3ecafc960d8f7fd50c71912c87d2588db52
411
py
Python
exercises/structures/test/test_treasure_map.py
bmazey/summer2020
0e943c356677f1d0ec55da5fe4b30a54b37507cd
[ "MIT" ]
null
null
null
exercises/structures/test/test_treasure_map.py
bmazey/summer2020
0e943c356677f1d0ec55da5fe4b30a54b37507cd
[ "MIT" ]
null
null
null
exercises/structures/test/test_treasure_map.py
bmazey/summer2020
0e943c356677f1d0ec55da5fe4b30a54b37507cd
[ "MIT" ]
null
null
null
from exercises.structures.src.treasure_map import TreasureMap tm = TreasureMap() tm.populate_map() def test_beach_key(): assert tm.map['beach'] == 'sandy shore'.casefold() def test_coast_key(): assert tm.map['coast'] == 'ocean reef'.casefold() def test_volcano_key(): assert tm.map['volcano'] == 'hot ...
19.571429
61
0.681265
from exercises.structures.src.treasure_map import TreasureMap tm = TreasureMap() tm.populate_map() def test_beach_key(): assert tm.map['beach'] == 'sandy shore'.casefold() def test_coast_key(): assert tm.map['coast'] == 'ocean reef'.casefold() def test_volcano_key(): assert tm.map['volcano'] == 'hot ...
true
true
f710a51bd1266dc4b0e1f75441f19122c01ede92
16,497
py
Python
.vscode-server/data/User/History/-1f47d17c/Kqqg.py
UNIZAR-30226-2022-09/back-end
7f20e141e34bf0ae7cce70515a1e4bb0cd85b173
[ "MIT" ]
null
null
null
.vscode-server/data/User/History/-1f47d17c/Kqqg.py
UNIZAR-30226-2022-09/back-end
7f20e141e34bf0ae7cce70515a1e4bb0cd85b173
[ "MIT" ]
1
2022-02-16T12:12:43.000Z
2022-02-16T12:15:03.000Z
.vscode-server/data/User/History/-1f47d17c/Kqqg.py
UNIZAR-30226-2022-09/back-end
7f20e141e34bf0ae7cce70515a1e4bb0cd85b173
[ "MIT" ]
null
null
null
# from flask import Flask, Blueprint # from flask_sqlalchemy import SQLAlchemy # from flask_login import LoginManager # import os from flask import Flask, jsonify, request, make_response, redirect, url_for import jwt import datetime import os from functools import wraps from flask_sqlalchemy import SQLAlchemy import u...
33.874743
235
0.655695
from flask import Flask, jsonify, request, make_response, redirect, url_for import jwt import datetime import os from functools import wraps from flask_sqlalchemy import SQLAlchemy import uuid from werkzeug.security import generate_password_hash, check_password_hash from werkzeug.utils import secure_filename from ...
true
true
f710a56d3627ff3cc484543b10918a7e02d8f710
348
py
Python
IPython/config/profile/python3/ipython_config.py
dchichkov/ipython
8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4
[ "BSD-3-Clause-Clear" ]
1
2015-01-09T21:10:58.000Z
2015-01-09T21:10:58.000Z
IPython/config/profile/python3/ipython_config.py
dchichkov/ipython
8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4
[ "BSD-3-Clause-Clear" ]
3
2015-04-01T13:14:57.000Z
2015-05-26T16:01:37.000Z
IPython/config/profile/python3/ipython_config.py
dchichkov/ipython
8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4
[ "BSD-3-Clause-Clear" ]
1
2015-05-17T14:14:26.000Z
2015-05-17T14:14:26.000Z
c = get_config() # If the master config file uses syntax that's invalid in Python 3, we'll skip # it and just use the factory defaults. try: load_subconfig('ipython_config.py', profile='default') except Exception: pass else: # We reset exec_lines in case they're not compatible with Python 3. c.Interact...
29
78
0.729885
c = get_config() try: load_subconfig('ipython_config.py', profile='default') except Exception: pass else: c.InteractiveShellApp.exec_lines = []
true
true
f710a66be19e70b5868e552408578511804999cb
5,061
py
Python
fastestimator/trace/metric/mcc.py
DwijayDS/fastestimator
9b288cb2bd870f971ec4cee09d0b3205e1316a94
[ "Apache-2.0" ]
null
null
null
fastestimator/trace/metric/mcc.py
DwijayDS/fastestimator
9b288cb2bd870f971ec4cee09d0b3205e1316a94
[ "Apache-2.0" ]
null
null
null
fastestimator/trace/metric/mcc.py
DwijayDS/fastestimator
9b288cb2bd870f971ec4cee09d0b3205e1316a94
[ "Apache-2.0" ]
null
null
null
# Copyright 2019 The FastEstimator Authors. All Rights Reserved. # # 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 appl...
45.1875
120
0.657182
from typing import Union, Iterable import numpy as np from sklearn.metrics import matthews_corrcoef from fastestimator.trace.meta._per_ds import per_ds from fastestimator.trace.trace import Trace from fastestimator.util.data import Any, Data, Dict from fastestimator.util.traceability_util import traceab...
true
true
f710a6a1dbb11d687aae20d29ee76bd20dcd3030
89
py
Python
blackdog/admin.py
UncleGoogle/dafipost
5e19d6a69dde9b7e5267bbdba680906bdb5e56eb
[ "MIT" ]
null
null
null
blackdog/admin.py
UncleGoogle/dafipost
5e19d6a69dde9b7e5267bbdba680906bdb5e56eb
[ "MIT" ]
1
2021-02-08T01:44:32.000Z
2021-02-08T01:44:32.000Z
blackdog/admin.py
UncleGoogle/dafipost
5e19d6a69dde9b7e5267bbdba680906bdb5e56eb
[ "MIT" ]
null
null
null
from django.contrib import admin from . import models admin.site.register(models.Bark)
14.833333
32
0.797753
from django.contrib import admin from . import models admin.site.register(models.Bark)
true
true
f710a6c24308bd6ba7693092f6d121cecdb9b7b8
1,607
py
Python
inaccel/keras/applications/imagenet_utils.py
inaccel/keras
bebd0ca930b9e2c2aee320e2e40b3d00cd15e46a
[ "Apache-2.0" ]
1
2021-01-27T12:20:35.000Z
2021-01-27T12:20:35.000Z
inaccel/keras/applications/imagenet_utils.py
inaccel/keras
bebd0ca930b9e2c2aee320e2e40b3d00cd15e46a
[ "Apache-2.0" ]
null
null
null
inaccel/keras/applications/imagenet_utils.py
inaccel/keras
bebd0ca930b9e2c2aee320e2e40b3d00cd15e46a
[ "Apache-2.0" ]
null
null
null
"""Utilities for ImageNet data preprocessing & prediction decoding. """ import json import keras.utils.data_utils as data_utils CLASS_INDEX = None CLASS_INDEX_PATH = ('https://storage.googleapis.com/download.tensorflow.org/' 'data/imagenet_class_index.json') def decode_predictions(preds, top=5): ...
33.479167
77
0.613566
import json import keras.utils.data_utils as data_utils CLASS_INDEX = None CLASS_INDEX_PATH = ('https://storage.googleapis.com/download.tensorflow.org/' 'data/imagenet_class_index.json') def decode_predictions(preds, top=5): global CLASS_INDEX if len(preds.shape) != 2 or preds.shape[1] !...
true
true
f710a7f55ec93a0f5804d75f8bd5493b3a4d1321
3,798
py
Python
tests/accounts/ecdsa_test.py
mustafa-travisci/lto-api.python
0493a46b69575e94d09a038dadf472b46f88d036
[ "MIT" ]
null
null
null
tests/accounts/ecdsa_test.py
mustafa-travisci/lto-api.python
0493a46b69575e94d09a038dadf472b46f88d036
[ "MIT" ]
null
null
null
tests/accounts/ecdsa_test.py
mustafa-travisci/lto-api.python
0493a46b69575e94d09a038dadf472b46f88d036
[ "MIT" ]
null
null
null
import copy from lto.accounts.ecdsa.account_factory_ecdsa import AccountFactoryECDSA import base58 import pytest from lto.transactions.anchor import Anchor class TestAccountECDSA(): factory = AccountFactoryECDSA('L') seed = 'divert manage prefer child kind maximum october hand manual connect fitness small sym...
50.64
199
0.718273
import copy from lto.accounts.ecdsa.account_factory_ecdsa import AccountFactoryECDSA import base58 import pytest from lto.transactions.anchor import Anchor class TestAccountECDSA(): factory = AccountFactoryECDSA('L') seed = 'divert manage prefer child kind maximum october hand manual connect fitness small sym...
true
true
f710a859d9f52e08d86ed3ddb3b5b3af0b18ffd1
1,351
py
Python
consolemenu/items/command_item.py
Gimli76/console-menu
febd66a49c199fb349a54499ff267c15e0e04bd9
[ "MIT" ]
1
2021-02-17T21:18:32.000Z
2021-02-17T21:18:32.000Z
consolemenu/items/command_item.py
Gimli76/console-menu
febd66a49c199fb349a54499ff267c15e0e04bd9
[ "MIT" ]
10
2020-06-05T23:30:34.000Z
2021-09-22T18:56:54.000Z
consolemenu/items/command_item.py
Gimli76/console-menu
febd66a49c199fb349a54499ff267c15e0e04bd9
[ "MIT" ]
null
null
null
import subprocess from consolemenu.items import ExternalItem class CommandItem(ExternalItem): """ A menu item to execute a console command """ def __init__(self, text, command, arguments=None, menu=None, should_exit=False): """ :ivar str command: The console command to be executed ...
30.704545
99
0.623242
import subprocess from consolemenu.items import ExternalItem class CommandItem(ExternalItem): def __init__(self, text, command, arguments=None, menu=None, should_exit=False): super(CommandItem, self).__init__(text=text, menu=menu, should_exit=should_exit) self.command = command if argum...
true
true
f710a98119943a2f7fadb0a04b71a3e85f1d84f5
722
py
Python
tests/binpacking/solver/test_statistics.py
Jxtopher/binpacking
6ce2a1cd071a0660c32f17f05298dde42942a2d9
[ "MIT" ]
1
2021-12-27T12:37:58.000Z
2021-12-27T12:37:58.000Z
tests/binpacking/solver/test_statistics.py
Jxtopher/binpacking
6ce2a1cd071a0660c32f17f05298dde42942a2d9
[ "MIT" ]
null
null
null
tests/binpacking/solver/test_statistics.py
Jxtopher/binpacking
6ce2a1cd071a0660c32f17f05298dde42942a2d9
[ "MIT" ]
null
null
null
from tests.base import BaseTestCase from binpacking.solver.data_structure.solution import Solution from binpacking.solver.statistics import Statistics, StatisticIteration, StatisticFitness class StatisticsTest(BaseTestCase): def test_statistics(self) -> None: iteration = StatisticIteration() fitn...
28.88
89
0.691136
from tests.base import BaseTestCase from binpacking.solver.data_structure.solution import Solution from binpacking.solver.statistics import Statistics, StatisticIteration, StatisticFitness class StatisticsTest(BaseTestCase): def test_statistics(self) -> None: iteration = StatisticIteration() fitn...
true
true
f710aa5ecac09bdab7ddb4892fe162790bf8b77d
6,807
py
Python
sdk/python/pulumi_aws/athena/database.py
Otanikotani/pulumi-aws
00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/athena/database.py
Otanikotani/pulumi-aws
00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_aws/athena/database.py
Otanikotani/pulumi-aws
00e2b352da42c5b1b0ec7b4760eec5ad2b23ff21
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilitie...
46.623288
288
0.665785
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from . import outputs from ._inputs import * __all__ = ['Database'] class Database(pulumi.CustomResource): def __init__(__self__, resource_name: s...
true
true
f710aa676b7ed87b52497df6e971ab5a80b028fe
1,281
py
Python
typos.py
Ulzahk/Practica-Selenium-Python
f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf
[ "MIT" ]
null
null
null
typos.py
Ulzahk/Practica-Selenium-Python
f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf
[ "MIT" ]
null
null
null
typos.py
Ulzahk/Practica-Selenium-Python
f2d0f215afb8ebba019544b3eb60cf2f7f23ddbf
[ "MIT" ]
null
null
null
import unittest from selenium import webdriver class Typos(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome(executable_path = r'./chromedriver.exe') driver = self.driver driver.get('http://the-internet.herokuapp.com/') driver.find_element_by_link_text('Typos').cl...
29.113636
103
0.615925
import unittest from selenium import webdriver class Typos(unittest.TestCase): def setUp(self): self.driver = webdriver.Chrome(executable_path = r'./chromedriver.exe') driver = self.driver driver.get('http://the-internet.herokuapp.com/') driver.find_element_by_link_text('Typos').cl...
true
true
f710aa9ee8bb044fb5cf58191f744088af8709bd
1,030
py
Python
sherlock-and-the-valid-string.py
gauravkanoongo/cp
f33cec95c121876a737b0a90faa2a51238be52a3
[ "MIT" ]
null
null
null
sherlock-and-the-valid-string.py
gauravkanoongo/cp
f33cec95c121876a737b0a90faa2a51238be52a3
[ "MIT" ]
null
null
null
sherlock-and-the-valid-string.py
gauravkanoongo/cp
f33cec95c121876a737b0a90faa2a51238be52a3
[ "MIT" ]
1
2021-09-19T13:04:41.000Z
2021-09-19T13:04:41.000Z
#!/bin/python3 import math import os import random import re import sys # # Complete the 'isValid' function below. # # The function is expected to return a STRING. # The function accepts STRING s as parameter. # def isValid(s): # Write your code here # Write your code here freq = {i : s.count(i) for i in...
20.6
66
0.526214
import math import os import random import re import sys def isValid(s): freq = {i : s.count(i) for i in set(s)} fv = list(freq.values()) ffreq = {v : list(fv).count(v) for v in set(fv)} print("s:",s, "\nfreq:", freq, "\nfv:", fv, "\nffreq:", ffreq) if len(ffreq)>2: retur...
true
true
f710aac2afd303f05b5049f4348f7aafb94efd9a
546
py
Python
account/account_sample.py
appenz/minebot
e1bd18053873c4d686de57e014a2cd8f27d4dd4c
[ "Apache-2.0" ]
11
2021-08-28T18:21:43.000Z
2022-03-08T16:08:55.000Z
account/account_sample.py
appenz/minebot
e1bd18053873c4d686de57e014a2cd8f27d4dd4c
[ "Apache-2.0" ]
3
2022-02-05T17:47:53.000Z
2022-03-10T17:36:48.000Z
account/account_sample.py
appenz/minebot
e1bd18053873c4d686de57e014a2cd8f27d4dd4c
[ "Apache-2.0" ]
5
2022-02-04T19:12:50.000Z
2022-03-18T20:54:00.000Z
# # Account information # # Copy this file to account.py and fill in the real values for the Minecraft account. # # # # account = { "user" : 'your@login.com', "password" : 'your_password', "master" : 'minecraft_name_who_the_bot_will_listen_to', "host" : 'exampleserver.wha...
21
85
0.569597
account = { "user" : 'your@login.com', "password" : 'your_password', "master" : 'minecraft_name_who_the_bot_will_listen_to', "host" : 'exampleserver.whatever.com', "version" : '1.16.5', } locations = { "minedrop": [29,13,-19], "farmdr...
true
true
f710aad9fae96e7df461ea9dc6b3959777fae07a
3,074
py
Python
apps/courts/views.py
gooseswan2/rent-a-court
2bba4b94e2b1a3deae6f6e0e15f35aef1e8aa963
[ "MIT" ]
null
null
null
apps/courts/views.py
gooseswan2/rent-a-court
2bba4b94e2b1a3deae6f6e0e15f35aef1e8aa963
[ "MIT" ]
null
null
null
apps/courts/views.py
gooseswan2/rent-a-court
2bba4b94e2b1a3deae6f6e0e15f35aef1e8aa963
[ "MIT" ]
null
null
null
from django.shortcuts import render,redirect from django.contrib import messages from django.template import Context from .models import Court, CourtManager, SelectedCourt from apps.users.models import User from datetime import datetime from decimal import Decimal from django.contrib.auth.decorators import login_requir...
30.74
118
0.617437
from django.shortcuts import render,redirect from django.contrib import messages from django.template import Context from .models import Court, CourtManager, SelectedCourt from apps.users.models import User from datetime import datetime from decimal import Decimal from django.contrib.auth.decorators import login_requir...
true
true
f710ab8364bbdcbe4c3b37527988de78e77269bb
5,653
py
Python
test/test_mpc.py
AwhLorraine/mshoot
d6981fa37c55da0457ac0371f9850743858a3543
[ "BSD-3-Clause" ]
14
2019-01-15T14:30:43.000Z
2022-02-06T08:36:36.000Z
test/test_mpc.py
AwhLorraine/mshoot
d6981fa37c55da0457ac0371f9850743858a3543
[ "BSD-3-Clause" ]
4
2019-02-01T10:32:48.000Z
2021-02-21T08:53:53.000Z
test/test_mpc.py
AwhLorraine/mshoot
d6981fa37c55da0457ac0371f9850743858a3543
[ "BSD-3-Clause" ]
5
2019-02-08T09:20:52.000Z
2021-04-25T02:17:54.000Z
import unittest import os import numpy as np import pandas as pd from scipy.signal import StateSpace import matplotlib.pyplot as plt import mshoot def cfun(xdf, ydf): """ :param ydf: DataFrame, model states :param ydf: DataFrame, model outputs :return: float """ qout = ydf['qout'].values ...
30.556757
110
0.523262
import unittest import os import numpy as np import pandas as pd from scipy.signal import StateSpace import matplotlib.pyplot as plt import mshoot def cfun(xdf, ydf): qout = ydf['qout'].values c = np.sum(qout ** 2) / qout.size return c class TestMPC(unittest.TestCase): def setUp(self): fm...
true
true
f710abb49b22c3947a49393e8d333e11f696684b
90,076
py
Python
src/edges_cal/cal_coefficients.py
edges-collab/edges-cal
9b7b28f71e1aa5347f901af38ef3bc0d28766e21
[ "MIT" ]
null
null
null
src/edges_cal/cal_coefficients.py
edges-collab/edges-cal
9b7b28f71e1aa5347f901af38ef3bc0d28766e21
[ "MIT" ]
86
2020-02-07T23:00:23.000Z
2022-03-31T22:08:19.000Z
src/edges_cal/cal_coefficients.py
edges-collab/edges-cal
9b7b28f71e1aa5347f901af38ef3bc0d28766e21
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ The main user-facing module of ``edges-cal``. This module contains wrappers around lower-level functions in other modules, providing a one-stop interface for everything related to calibration. """ from __future__ import annotations import attr import h5py import numpy as np import tempfile...
34.197418
88
0.566877
from __future__ import annotations import attr import h5py import numpy as np import tempfile import warnings import yaml from abc import ABCMeta, abstractmethod from astropy.convolution import Gaussian1DKernel, convolve from copy import copy from edges_io import io from edges_io.logging import logger from functools ...
true
true
f710ac528885b1b93f31c632c55a3507e9b7fd6d
3,475
py
Python
pipe-cli/mount/pipefuse/fslock.py
cmbkoko1989/cloud-pipeline
9af1218151ef02f87915726eb92c0cc626f7ab11
[ "Apache-2.0" ]
null
null
null
pipe-cli/mount/pipefuse/fslock.py
cmbkoko1989/cloud-pipeline
9af1218151ef02f87915726eb92c0cc626f7ab11
[ "Apache-2.0" ]
null
null
null
pipe-cli/mount/pipefuse/fslock.py
cmbkoko1989/cloud-pipeline
9af1218151ef02f87915726eb92c0cc626f7ab11
[ "Apache-2.0" ]
null
null
null
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/) # # 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 appli...
30.217391
111
0.624748
import logging import time from abc import ABCMeta, abstractmethod from threading import RLock, Thread from fuse import fuse_get_context def get_lock(threads, monitoring_delay): return PathLock(monitoring_delay=monitoring_delay) if threads else DummyLock() def monitor_locks(monitor_lock, locks, t...
true
true
f710ad5b4f762a06f4cdaff930cc88bfc18dba57
1,778
py
Python
tutorials/ngsi_v2/e2_healthcheck/e2_healthcheck_solution.py
N5GEH/FiLiP
d24f47daa272a65ccf9c92522374bc5228b9a3d1
[ "BSD-3-Clause" ]
null
null
null
tutorials/ngsi_v2/e2_healthcheck/e2_healthcheck_solution.py
N5GEH/FiLiP
d24f47daa272a65ccf9c92522374bc5228b9a3d1
[ "BSD-3-Clause" ]
null
null
null
tutorials/ngsi_v2/e2_healthcheck/e2_healthcheck_solution.py
N5GEH/FiLiP
d24f47daa272a65ccf9c92522374bc5228b9a3d1
[ "BSD-3-Clause" ]
null
null
null
""" # # Exercise 2: Service Health Check # Create one or multiple filip clients and check if the corresponding services # are up and running by accessing their version information. # The input sections are marked with 'ToDo' # #### Steps to complete: # 1. Set up the missing parameters in the parameter section # 2. C...
32.327273
78
0.722722
\ HttpClient, \ HttpClientConfig, \ ContextBrokerClient, \ IoTAClient, \ QuantumLeapClient ost:1026" IOTA_URL = "http://localhost:4041" QL_URL = "http://localhost:8668" cbc = ContextBrokerClient(url=CB_URL) print(cbc.get_version()) iotac = IoTAClient(url=IOTA_URL) pr...
true
true
f710adad5bc915650b1798112ca08af0d8455670
87
py
Python
urban_dictionary/__init__.py
accessware/urban_dictionary
8ebe477dc477850c3e2ce3c0fbb6a32b2ffb3e80
[ "MIT" ]
null
null
null
urban_dictionary/__init__.py
accessware/urban_dictionary
8ebe477dc477850c3e2ce3c0fbb6a32b2ffb3e80
[ "MIT" ]
null
null
null
urban_dictionary/__init__.py
accessware/urban_dictionary
8ebe477dc477850c3e2ce3c0fbb6a32b2ffb3e80
[ "MIT" ]
null
null
null
from .base import AsyncUrbanClient, UrbanClient, UrbanDefinition, UrbanDictionaryError
43.5
86
0.873563
from .base import AsyncUrbanClient, UrbanClient, UrbanDefinition, UrbanDictionaryError
true
true
f710adfbd40b4b969e51b988eebe67de9aac564e
976
py
Python
cstock/model.py
dwarf-miner/midas
68ff19da4a1f1a095b9c37e2fd53b77a2e27e562
[ "MIT" ]
null
null
null
cstock/model.py
dwarf-miner/midas
68ff19da4a1f1a095b9c37e2fd53b77a2e27e562
[ "MIT" ]
null
null
null
cstock/model.py
dwarf-miner/midas
68ff19da4a1f1a095b9c37e2fd53b77a2e27e562
[ "MIT" ]
null
null
null
# Copyright (c) 2015 Walt Chen # # 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 class ParserException(Exception): pass ...
27.111111
80
0.623975
class ParserException(Exception): pass class Stock(object): def __init__(self, code, date, open, high, low, close, volume): self.code = code self.date = str(date) self.open = open self.high = high self.low = low self.close = c...
true
true
f710ae170b6af5321a2a68a244660e923a688a59
17,480
py
Python
test_module.py
aivision2020/OctSceneScan
3b22ecb4f701270f457a7c2d2702f758b8d584cf
[ "MIT" ]
2
2019-01-18T04:10:00.000Z
2019-12-03T13:03:03.000Z
test_module.py
aivision2020/OctSceneScan
3b22ecb4f701270f457a7c2d2702f758b8d584cf
[ "MIT" ]
null
null
null
test_module.py
aivision2020/OctSceneScan
3b22ecb4f701270f457a7c2d2702f758b8d584cf
[ "MIT" ]
1
2019-12-03T13:03:04.000Z
2019-12-03T13:03:04.000Z
from pathlib import Path import copy import time import torch.optim as optim import numpy as np import torch from torch.autograd import Variable from model import * from data_utils import * import torch.nn as nn from loguru import logger feature_dim = 8 block_size = 16 pad=2 n_conv=3 thresh=0.5 debug = False def test...
36.877637
124
0.602918
from pathlib import Path import copy import time import torch.optim as optim import numpy as np import torch from torch.autograd import Variable from model import * from data_utils import * import torch.nn as nn from loguru import logger feature_dim = 8 block_size = 16 pad=2 n_conv=3 thresh=0.5 debug = False def test...
true
true
f710aede0129116fd2fbd1706cf9d313de1a2393
7,133
py
Python
tests/unitTests/scripts/todo/aggregates.py
declarativitydotnet/p2
59fa258b222a5ff0e6930da4f08acd6155cd378e
[ "BSD-3-Clause" ]
3
2016-01-26T22:19:12.000Z
2019-07-10T02:12:38.000Z
tests/unitTests/scripts/todo/aggregates.py
declarativitydotnet/p2
59fa258b222a5ff0e6930da4f08acd6155cd378e
[ "BSD-3-Clause" ]
null
null
null
tests/unitTests/scripts/todo/aggregates.py
declarativitydotnet/p2
59fa258b222a5ff0e6930da4f08acd6155cd378e
[ "BSD-3-Clause" ]
null
null
null
# # * This file is distributed under the terms in the attached LICENSE file. # * If you do not find this file, copies can be found by writing to: # * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, # * Berkeley, CA, 94704. Attention: Intel License Inquiry. # * Or # * UC Berkeley EECS Computer Science Divis...
38.349462
218
0.633674
localhost:20202\)\] .* [#][#]Print\[RecvEvent \s* RULE \s* d1\]: \s* \[largestNeighborOf\(localhost:20204, \s* localhost:20203\)\]) """, re.VERBOSE|re.DOTALL) flag = p.search(output) if flag == 0: print "Test failed" return else: p...
false
true
f710af55b32c135974a5c15c3146454eeed3d709
99
py
Python
venv/lib/python2.7/fnmatch.py
MPikDev/withings_weight_display
8d0a91c949cc9c2f1323db9986f68330cf21e4bf
[ "MIT" ]
null
null
null
venv/lib/python2.7/fnmatch.py
MPikDev/withings_weight_display
8d0a91c949cc9c2f1323db9986f68330cf21e4bf
[ "MIT" ]
null
null
null
venv/lib/python2.7/fnmatch.py
MPikDev/withings_weight_display
8d0a91c949cc9c2f1323db9986f68330cf21e4bf
[ "MIT" ]
null
null
null
/usr/local/Cellar/python/2.7.14_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fnmatch.py
99
99
0.818182
/usr/local/Cellar/python/2.7.14_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/fnmatch.py
false
true
f710afbeab8f04438a21a36fc543f2a0407a5051
5,568
py
Python
code/classification/svm_bayes_classification.py
magnuskiro/master
39d622e70990a4ea784bb2c6f724571c795f8ae3
[ "MIT" ]
3
2017-02-11T23:25:12.000Z
2017-02-11T23:31:04.000Z
code/classification/svm_bayes_classification.py
magnuskiro/master
39d622e70990a4ea784bb2c6f724571c795f8ae3
[ "MIT" ]
null
null
null
code/classification/svm_bayes_classification.py
magnuskiro/master
39d622e70990a4ea784bb2c6f724571c795f8ae3
[ "MIT" ]
null
null
null
# coding=utf-8 import nltk from classification_utils import get_lines_from_file, load_manually_labeled_tweets, aggregate_results from sklearn.svm import LinearSVC, NuSVC, NuSVR, OneClassSVM, SVC, SVR from nltk.classify.scikitlearn import SklearnClassifier __author__ = 'kiro' def get_list_of_possible_words_in_tweets(...
36.392157
120
0.711566
import nltk from classification_utils import get_lines_from_file, load_manually_labeled_tweets, aggregate_results from sklearn.svm import LinearSVC, NuSVC, NuSVR, OneClassSVM, SVC, SVR from nltk.classify.scikitlearn import SklearnClassifier __author__ = 'kiro' def get_list_of_possible_words_in_tweets(): """ ...
false
true
f710aff6c2d00b414cf21367b621f613665ccf10
14,123
py
Python
sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_indexing_buffered_sender_async.py
adewaleo/azure-sdk-for-python
169457edbea5e3c5557246cfcf8bd635d528bae4
[ "MIT" ]
1
2020-03-05T18:10:35.000Z
2020-03-05T18:10:35.000Z
sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_indexing_buffered_sender_async.py
adewaleo/azure-sdk-for-python
169457edbea5e3c5557246cfcf8bd635d528bae4
[ "MIT" ]
2
2020-03-03T23:11:13.000Z
2020-03-30T18:50:55.000Z
sdk/search/azure-search-documents/azure/search/documents/_internal/aio/_search_indexing_buffered_sender_async.py
adewaleo/azure-sdk-for-python
169457edbea5e3c5557246cfcf8bd635d528bae4
[ "MIT" ]
1
2021-05-19T02:55:10.000Z
2021-05-19T02:55:10.000Z
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from typin...
42.032738
117
0.631523
from typing import cast, List, TYPE_CHECKING import time from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.exceptions import ServiceResponseTimeoutError from ._timer import Timer from .._utils import is_retryable_status_code from .._search_indexing_buffered_sender_base import ...
true
true
f710b041e326ba3e1326272da4562dee10691198
22,120
py
Python
reports/migrations/0002_populate_weights.py
digideskio/gmmp
d82a4be0787c3a3a9e27dc590d7974f9f884fbb6
[ "Apache-2.0" ]
2
2015-04-02T23:09:03.000Z
2015-12-03T00:19:06.000Z
reports/migrations/0002_populate_weights.py
digideskio/gmmp
d82a4be0787c3a3a9e27dc590d7974f9f884fbb6
[ "Apache-2.0" ]
13
2015-04-01T07:39:43.000Z
2015-08-26T06:24:07.000Z
reports/migrations/0002_populate_weights.py
OpenUpSA/gmmp
d82a4be0787c3a3a9e27dc590d7974f9f884fbb6
[ "Apache-2.0" ]
2
2019-07-25T11:53:10.000Z
2020-06-22T02:07:40.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django_countries import countries def populate_weights(apps, schema_editor): Weights = apps.get_model("reports", "Weights") db_alias = schema_editor.connection.alias for item in COUNTRY_WEIGHTS: ...
20.692236
65
0.494711
from __future__ import unicode_literals from django.db import migrations from django_countries import countries def populate_weights(apps, schema_editor): Weights = apps.get_model("reports", "Weights") db_alias = schema_editor.connection.alias for item in COUNTRY_WEIGHTS: country = item['Country...
true
true
f710b17920f4b27ff5f612fbae4bb033721cb956
5,980
py
Python
Flask-Web/flasky/app/auth/views.py
fengzse/Feng_Repository
a0c64cbdff09e536be23eeccf45bdf6cab62d78b
[ "Apache-2.0" ]
1
2021-01-02T22:03:13.000Z
2021-01-02T22:03:13.000Z
Flask-Web/flasky/app/auth/views.py
fengzse/Feng_Repository
a0c64cbdff09e536be23eeccf45bdf6cab62d78b
[ "Apache-2.0" ]
null
null
null
Flask-Web/flasky/app/auth/views.py
fengzse/Feng_Repository
a0c64cbdff09e536be23eeccf45bdf6cab62d78b
[ "Apache-2.0" ]
null
null
null
from flask import render_template, redirect, request, url_for, flash from flask_login import login_user, logout_user, login_required, current_user from . import auth from .. import db from ..models import User from .forms import LoginForm, RegistrationForm, ChangePasswordForm, ResetPassword, ResetPasswordRequest, \ ...
37.142857
112
0.673746
from flask import render_template, redirect, request, url_for, flash from flask_login import login_user, logout_user, login_required, current_user from . import auth from .. import db from ..models import User from .forms import LoginForm, RegistrationForm, ChangePasswordForm, ResetPassword, ResetPasswordRequest, \ ...
true
true
f710b29b9753ff4ea7a019d0d600cff9936b42f5
6,366
py
Python
examples/table.py
gungnir888/transitfeed3
406e7ca3fe274521ef5dbf9277c729182b5183cb
[ "Apache-2.0" ]
null
null
null
examples/table.py
gungnir888/transitfeed3
406e7ca3fe274521ef5dbf9277c729182b5183cb
[ "Apache-2.0" ]
null
null
null
examples/table.py
gungnir888/transitfeed3
406e7ca3fe274521ef5dbf9277c729182b5183cb
[ "Apache-2.0" ]
null
null
null
# Copyright (C) 2007 Google 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 applicable law or agreed to in writ...
35.966102
112
0.617499
import transitfeed from optparse import OptionParser import re stops = {} ule, table): if len(table) >= 2: r = schedule.add_route(short_name=table[0][0], long_name=table[0][1], route_type='Bus') for trip in table[2:]: if len(trip) > len(table[1]): ...
true
true
f710b3d9f778c9716dcab7db75b7a4bc66a1cc43
1,565
py
Python
fairseq/data/fairseq_dataset.py
nadongguri/fairseq
b651b000033fd8ff51d1c3bea76f4fd1897bdf9c
[ "MIT" ]
50
2021-11-15T02:34:43.000Z
2021-11-18T07:24:46.000Z
codes_src/fairseq/data/fairseq_dataset.py
yujun531/WeTS
bba33ad64e10efd7d3d95b5a0b6ad125216542cf
[ "Unlicense" ]
null
null
null
codes_src/fairseq/data/fairseq_dataset.py
yujun531/WeTS
bba33ad64e10efd7d3d95b5a0b6ad125216542cf
[ "Unlicense" ]
26
2021-11-15T02:35:14.000Z
2021-11-15T08:25:42.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np import torch.utils.data class FairseqDataset(torch.utils.data.Dataset): """A dataset that provides helpers for batchi...
29.528302
80
0.654313
import numpy as np import torch.utils.data class FairseqDataset(torch.utils.data.Dataset): def __getitem__(self, index): raise NotImplementedError def __len__(self): raise NotImplementedError def collater(self, samples): raise NotImplementedError def num_tokens(self, i...
true
true
f710b53acc9fd1364a5a8782c79a63384e6720e2
2,158
py
Python
aptronics/bundling.py
agritheory/aptronics
0a40ae3bf787fc3a1525ae3556ea6dca0ca31408
[ "MIT" ]
null
null
null
aptronics/bundling.py
agritheory/aptronics
0a40ae3bf787fc3a1525ae3556ea6dca0ca31408
[ "MIT" ]
34
2019-09-28T15:04:32.000Z
2020-02-26T11:11:20.000Z
aptronics/bundling.py
agritheory/aptronics
0a40ae3bf787fc3a1525ae3556ea6dca0ca31408
[ "MIT" ]
2
2016-02-17T16:39:55.000Z
2019-10-15T21:11:51.000Z
import frappe from frappe.utils import flt def merge_bundled_items(self, method): bundles = {} item_meta = frappe.get_meta(self.doctype + " Item") count = 0 copy_fields = ['qty', 'stock_qty'] sum_fields = ['total_weight', 'amount', 'net_amount'] rate_fields = [('rate', 'amount'), ('net_rate', 'net_amount'), ('w...
30.394366
100
0.694161
import frappe from frappe.utils import flt def merge_bundled_items(self, method): bundles = {} item_meta = frappe.get_meta(self.doctype + " Item") count = 0 copy_fields = ['qty', 'stock_qty'] sum_fields = ['total_weight', 'amount', 'net_amount'] rate_fields = [('rate', 'amount'), ('net_rate', 'net_amount'), ('w...
true
true
f710b5892d3ceb61675ec956d63092918bac41e6
4,736
py
Python
src/sentry/interfaces/contexts.py
pierredup/sentry
0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80
[ "BSD-3-Clause" ]
1
2019-10-17T17:46:16.000Z
2019-10-17T17:46:16.000Z
src/sentry/interfaces/contexts.py
pierredup/sentry
0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80
[ "BSD-3-Clause" ]
null
null
null
src/sentry/interfaces/contexts.py
pierredup/sentry
0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import import six import string from django.utils.encoding import force_text from sentry.interfaces.base import Interface from sentry.utils.json import prune_empty_keys from sentry.utils.safe import get_path, trim __all__ = ("Contexts",) context_types = {} class _IndexFormatter(st...
26.606742
99
0.611275
from __future__ import absolute_import import six import string from django.utils.encoding import force_text from sentry.interfaces.base import Interface from sentry.utils.json import prune_empty_keys from sentry.utils.safe import get_path, trim __all__ = ("Contexts",) context_types = {} class _IndexFormatter(st...
true
true