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
417k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
1 class
is_sharp_comment_removed
bool
1 class
f71a4d41c019c5c22fe4a775dccecbf2510b5ece
7,159
py
Python
flash/image/classification/integrations/baal/loop.py
twsl/lightning-flash
9927853ac23551b444dbe969e287879c69be4094
[ "Apache-2.0" ]
null
null
null
flash/image/classification/integrations/baal/loop.py
twsl/lightning-flash
9927853ac23551b444dbe969e287879c69be4094
[ "Apache-2.0" ]
null
null
null
flash/image/classification/integrations/baal/loop.py
twsl/lightning-flash
9927853ac23551b444dbe969e287879c69be4094
[ "Apache-2.0" ]
null
null
null
# Copyright The PyTorch Lightning team. # # 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 i...
42.613095
116
0.70778
from copy import deepcopy from typing import Any, Dict, Optional import torch from pytorch_lightning.loops import Loop from pytorch_lightning.loops.fit_loop import FitLoop from pytorch_lightning.trainer.connectors.data_connector import _PatchDataLoader from pytorch_lightning.trainer.progress import Progre...
true
true
f71a4e72b400b79bef2912f5ab1fa11a4cf0e50a
15,580
py
Python
GUI_functions/build_asp.py
AntonAlbertovich/Eusocial-Cluster-Utility
fef4f583b6151bb40e54d6825d65d668581c2121
[ "MIT" ]
2
2019-03-22T15:08:31.000Z
2019-03-23T20:10:40.000Z
GUI_functions/build_asp.py
AntonAlbertovich/Eusocial-Cluster-Utility
fef4f583b6151bb40e54d6825d65d668581c2121
[ "MIT" ]
1
2019-03-23T20:08:12.000Z
2019-03-23T20:08:12.000Z
GUI_functions/build_asp.py
AntonAlbertovich/Eusocial-Cluster-Utility
fef4f583b6151bb40e54d6825d65d668581c2121
[ "MIT" ]
1
2019-03-23T19:56:07.000Z
2019-03-23T19:56:07.000Z
import pickle # This is the script which builds a ASP model intended to be solved with clingo. # This program has been test on Ubuntu 18.04 and CentOS 7. # Using Clingo 5.3.0 installed via Conda # Parsing the output of this program will require clyngor-with-clingo which may be installed via pip. if __name__ == "__main...
52.635135
196
0.60706
import pickle if __name__ == "__main__": input_file= open("GUI_functions/Cluster_details.bin", "rb") all_macs= list(pickle.load(input_file)) input_file.close() input_file= open("GUI_functions/Tasks_details.bin", "rb") all_jobs= list(pickle.load(input_file)) input_file.close()...
true
true
f71a4eddc4f441ac7f58d13143c891e1a2b0e540
5,556
py
Python
datasets/dataloader_infer.py
Nitin-Mane/dense-ulearn-vos
9e39d359a53a2343522ce5820fdf27223a4ffcb4
[ "Apache-2.0" ]
157
2021-11-11T13:45:48.000Z
2022-03-14T03:06:09.000Z
datasets/dataloader_infer.py
Nitin-Mane/dense-ulearn-vos
9e39d359a53a2343522ce5820fdf27223a4ffcb4
[ "Apache-2.0" ]
11
2021-11-20T11:53:47.000Z
2022-03-30T01:51:56.000Z
datasets/dataloader_infer.py
Nitin-Mane/dense-ulearn-vos
9e39d359a53a2343522ce5820fdf27223a4ffcb4
[ "Apache-2.0" ]
16
2021-11-12T09:19:45.000Z
2022-03-16T10:32:39.000Z
""" Copyright (c) 2021 TU Darmstadt Author: Nikita Araslanov <nikita.araslanov@tu-darmstadt.de> License: Apache License 2.0 """ import os import torch from PIL import Image import numpy as np import torchvision.transforms as tf from .dataloader_base import DLBase class DataSeg(DLBase): def __init__(self, cfg...
33.071429
89
0.533837
import os import torch from PIL import Image import numpy as np import torchvision.transforms as tf from .dataloader_base import DLBase class DataSeg(DLBase): def __init__(self, cfg, split, ignore_labels=[], \ root=os.path.expanduser('./data'), renorm=False): super(DataSeg, self).__...
true
true
f71a4f157fbcfd39a6a5a1e24d4913bdf4df7d2c
6,777
py
Python
etna/analysis/eda_utils.py
Carlosbogo/etna
b6210f0e79ee92aa9ae8ff4fcfb267be9fb7cc94
[ "Apache-2.0" ]
null
null
null
etna/analysis/eda_utils.py
Carlosbogo/etna
b6210f0e79ee92aa9ae8ff4fcfb267be9fb7cc94
[ "Apache-2.0" ]
null
null
null
etna/analysis/eda_utils.py
Carlosbogo/etna
b6210f0e79ee92aa9ae8ff4fcfb267be9fb7cc94
[ "Apache-2.0" ]
null
null
null
import math import warnings from itertools import combinations from typing import TYPE_CHECKING from typing import Optional from typing import Sequence import matplotlib.pyplot as plt import numpy as np import seaborn as sns import statsmodels.api as sm from matplotlib.ticker import MaxNLocator from statsmodels.graphi...
34.576531
119
0.649255
import math import warnings from itertools import combinations from typing import TYPE_CHECKING from typing import Optional from typing import Sequence import matplotlib.pyplot as plt import numpy as np import seaborn as sns import statsmodels.api as sm from matplotlib.ticker import MaxNLocator from statsmodels.graphi...
true
true
f71a5114748409f8688b38305fe77035a3f0228a
2,251
py
Python
18_Working with Dates and Times in Python/03_Time Zones and Daylight Saving/05_What time did the bike leave.py
mohd-faizy/DataScience-With-Python
13ebb10cf9083343056d5b782957241de1d595f9
[ "MIT" ]
5
2021-02-03T14:36:58.000Z
2022-01-01T10:29:26.000Z
18_Working with Dates and Times in Python/03_Time Zones and Daylight Saving/05_What time did the bike leave.py
mohd-faizy/DataScience-With-Python
13ebb10cf9083343056d5b782957241de1d595f9
[ "MIT" ]
null
null
null
18_Working with Dates and Times in Python/03_Time Zones and Daylight Saving/05_What time did the bike leave.py
mohd-faizy/DataScience-With-Python
13ebb10cf9083343056d5b782957241de1d595f9
[ "MIT" ]
3
2021-02-08T00:31:16.000Z
2022-03-17T13:52:32.000Z
''' 05 - What time did the bike leave? (Global edition) When you need to move a datetime from one timezone into another, use .astimezone() and tz. Often you will be moving things into UTC, but for fun let's try moving things from 'America/New_York' into a few different time zones. -----------------------------...
27.120482
73
0.581519
uk = tz.gettz('Europe/London') local = onebike_datetimes[0]['start'] notlocal = local.astimezone(uk) print(local.isoformat()) print(notlocal.isoformat()) ist = tz.gettz('Asia/Kolkata') local = onebike_datetimes[0]['start'] notlocal = local.astimezone(ist) print(local.isoformat()) print(notlocal.isoforma...
true
true
f71a5174d2bf23ea7be1f3e9c5de988669aecc72
7,805
py
Python
src/tools/scripts/lofreq2_cluster.py
joshwkearney/lofreq
8966e95044875ec9068d2ea4d1cf72ed96d92781
[ "MIT" ]
74
2015-01-02T19:18:01.000Z
2022-02-25T04:16:18.000Z
src/tools/scripts/lofreq2_cluster.py
joshwkearney/lofreq
8966e95044875ec9068d2ea4d1cf72ed96d92781
[ "MIT" ]
125
2015-01-06T07:25:30.000Z
2022-03-15T12:56:23.000Z
src/tools/scripts/lofreq2_cluster.py
joshwkearney/lofreq
8966e95044875ec9068d2ea4d1cf72ed96d92781
[ "MIT" ]
31
2015-01-14T00:41:14.000Z
2022-02-16T14:45:13.000Z
#!/usr/bin/env python """Cluster SNVs based on SNV freqs confidence interval """ __author__ = "Andreas Wilm, Niranjan Nagarajan" __email__ = "wilma@gis.a-star.edu.sg" __copyright__ = "2013,2014 Genome Institute of Singapore" __license__ = "The MIT License" # --- standard library imports # import sys import logging...
30.251938
100
0.557207
__author__ = "Andreas Wilm, Niranjan Nagarajan" __email__ = "wilma@gis.a-star.edu.sg" __copyright__ = "2013,2014 Genome Institute of Singapore" __license__ = "The MIT License" import sys import logging import os import argparse from math import sqrt from collections import namedtuple from itertools import group...
true
true
f71a51a2c95b6595d277af331364047551e8377e
608
py
Python
problems/number-complement.py
sailikhithk/tech-interview-prep
e833764cf98915d56118bddfa0e01871c58de75e
[ "Apache-2.0" ]
null
null
null
problems/number-complement.py
sailikhithk/tech-interview-prep
e833764cf98915d56118bddfa0e01871c58de75e
[ "Apache-2.0" ]
null
null
null
problems/number-complement.py
sailikhithk/tech-interview-prep
e833764cf98915d56118bddfa0e01871c58de75e
[ "Apache-2.0" ]
null
null
null
""" First, we convert the num to its birary. ``` >>> bin(5) >>> '0b101' ``` Second, we need to return the base10 of binary's the complement. Complement is easy `'101' => '010'`. Turn to base10: ``` '010' => 0*pow(2, 2) + 1*pow(2, 1) + 0*pow(2, 0) '11011' => 1*pow(2, 4) + 1*pow(2, 3) + 0*pow(2, 2) + 1*pow(2, 1) + 1*pow...
23.384615
78
0.555921
class Solution(object): def findComplement(self, num): b = bin(num)[2:] opt = 0 for i, c in enumerate(reversed(b)): if c=='0': opt+=pow(2, i) return opt
true
true
f71a52383480c16caea8e9d42551045766340f5e
251
py
Python
jacoren/__version__.py
kuszaj/jacoren
42344982248ed688da8f3d9383ca4ae63f542cf3
[ "MIT" ]
1
2018-02-27T08:54:40.000Z
2018-02-27T08:54:40.000Z
jacoren/__version__.py
kuszaj/jacoren
42344982248ed688da8f3d9383ca4ae63f542cf3
[ "MIT" ]
null
null
null
jacoren/__version__.py
kuszaj/jacoren
42344982248ed688da8f3d9383ca4ae63f542cf3
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Package info.""" __version__ = '0.1.0' __title__ = 'jacoren' __description__ = '' __author__ = 'Piotr Kuszaj' __author_email__ = 'peterkuszaj@gmail.com' __license__ = 'MIT' __all__ = ('platform', 'cpu', 'memory', 'disks')
20.916667
48
0.657371
__version__ = '0.1.0' __title__ = 'jacoren' __description__ = '' __author__ = 'Piotr Kuszaj' __author_email__ = 'peterkuszaj@gmail.com' __license__ = 'MIT' __all__ = ('platform', 'cpu', 'memory', 'disks')
true
true
f71a5241dff474c819eaebc8af456389f5a76087
4,386
py
Python
tests/unit/test_task.py
lekshmimallika-aot/business-schemas
d95b43f1d04e29fd9bab101789c277db54123d9b
[ "Apache-2.0" ]
2
2020-02-05T21:36:27.000Z
2021-08-28T23:56:52.000Z
tests/unit/test_task.py
lekshmimallika-aot/business-schemas
d95b43f1d04e29fd9bab101789c277db54123d9b
[ "Apache-2.0" ]
13
2020-03-25T17:28:11.000Z
2022-03-30T20:06:04.000Z
tests/unit/test_task.py
lekshmimallika-aot/business-schemas
d95b43f1d04e29fd9bab101789c277db54123d9b
[ "Apache-2.0" ]
19
2020-01-31T23:11:47.000Z
2022-03-30T18:08:15.000Z
# Copyright © 2019 Province of British Columbia # # 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 agr...
27.4125
79
0.512312
from registry_schemas import validate from registry_schemas.example_data import FILING_HEADER, UNMANAGED def test_valid_task_todo(): task = { 'task': { 'todo': { 'business': { 'cacheId': 1, 'foundingDate': '2007-04-08T00:00:...
true
true
f71a524f93d7cd5915ce95bc5b60b531dbf7e8cf
18,115
py
Python
scons-local/SCons/Tool/GettextCommon.py
bibleuspro/scons
625d446ae8996ff1b3d660c44e2827fc832cf12b
[ "MIT" ]
1
2017-02-10T00:26:44.000Z
2017-02-10T00:26:44.000Z
scons-local/SCons/Tool/GettextCommon.py
bibleuspro/scons
625d446ae8996ff1b3d660c44e2827fc832cf12b
[ "MIT" ]
null
null
null
scons-local/SCons/Tool/GettextCommon.py
bibleuspro/scons
625d446ae8996ff1b3d660c44e2827fc832cf12b
[ "MIT" ]
null
null
null
"""SCons.Tool.GettextCommon module Used by several tools of `gettext` toolset. """ # Copyright (c) 2001 - 2014 The SCons Foundation # # 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 withou...
42.030162
96
0.599558
__revision__ = "src/engine/SCons/Tool/GettextCommon.py 2014/07/05 09:42:21 garyo" import SCons.Warnings import re
true
true
f71a5321b655a69d95438bc4946e72b3c1c4abfa
5,314
py
Python
scilab2py/utils.py
blink1073/scilab2py
d487828a7087890ce1e035a7c09c4819ff8276c4
[ "MIT" ]
8
2015-10-16T23:28:16.000Z
2020-06-19T18:49:18.000Z
scilab2py/utils.py
blink1073/scilab2py
d487828a7087890ce1e035a7c09c4819ff8276c4
[ "MIT" ]
8
2015-06-25T20:57:56.000Z
2020-04-03T22:33:16.000Z
scilab2py/utils.py
blink1073/scilab2py
d487828a7087890ce1e035a7c09c4819ff8276c4
[ "MIT" ]
6
2015-04-21T12:23:44.000Z
2021-10-01T00:08:47.000Z
""" .. module:: utils :synopsis: Miscellaneous helper constructs .. moduleauthor:: Steven Silvester <steven.silvester@ieee.org> """ import os import inspect import dis import tempfile import sys from .compat import PY2 def _remove_temp_files(dirname): """ Remove the created mat files in ...
26.974619
75
0.585058
import os import inspect import dis import tempfile import sys from .compat import PY2 def _remove_temp_files(dirname): import os import glob for fname in glob.glob(os.path.join(dirname, 'tmp*.mat')): try: os.remove(fname) except OSError: pass ...
true
true
f71a539e1bc739d74244c33e61ec48175b1a0e68
182
py
Python
yatube/yatube/urls.py
Cooke64/hw02_community
10005d05e0142ec9e68b3578d239b6e3da66c0a3
[ "BSD-3-Clause" ]
null
null
null
yatube/yatube/urls.py
Cooke64/hw02_community
10005d05e0142ec9e68b3578d239b6e3da66c0a3
[ "BSD-3-Clause" ]
null
null
null
yatube/yatube/urls.py
Cooke64/hw02_community
10005d05e0142ec9e68b3578d239b6e3da66c0a3
[ "BSD-3-Clause" ]
null
null
null
from django.contrib import admin from django.urls import include, path urlpatterns = [ path('', include('posts.urls', namespace='post')), path('admin/', admin.site.urls), ]
22.75
54
0.686813
from django.contrib import admin from django.urls import include, path urlpatterns = [ path('', include('posts.urls', namespace='post')), path('admin/', admin.site.urls), ]
true
true
f71a53b58b0c817babbdccd697976cfe68604cef
182
py
Python
Chapter 4/4-5.py
lzhang1/BeginningPygame
c239925041a6fa361386f65316ef4bea12c3b482
[ "MIT" ]
43
2015-09-20T02:05:48.000Z
2022-03-01T22:00:43.000Z
Chapter 4/4-5.py
lzhang1/BeginningPygame
c239925041a6fa361386f65316ef4bea12c3b482
[ "MIT" ]
null
null
null
Chapter 4/4-5.py
lzhang1/BeginningPygame
c239925041a6fa361386f65316ef4bea12c3b482
[ "MIT" ]
40
2015-05-19T06:51:13.000Z
2022-03-27T18:11:16.000Z
def lerp(value1, value2, factor): return value1+(value2-value1)*factor print(lerp(100, 200, 0.)) print(lerp(100, 200, 1.)) print(lerp(100, 200, .5)) print(lerp(100, 200, .25))
22.75
40
0.659341
def lerp(value1, value2, factor): return value1+(value2-value1)*factor print(lerp(100, 200, 0.)) print(lerp(100, 200, 1.)) print(lerp(100, 200, .5)) print(lerp(100, 200, .25))
true
true
f71a53e8b0bfef59cec65a1838904cf9ebf97f18
3,838
py
Python
paasta_tools/metrics/metrics_lib.py
xcorail/paasta
3f132c73b45fcf0afc31ddb889205ecd9394d4bb
[ "Apache-2.0" ]
null
null
null
paasta_tools/metrics/metrics_lib.py
xcorail/paasta
3f132c73b45fcf0afc31ddb889205ecd9394d4bb
[ "Apache-2.0" ]
4
2021-02-08T20:42:08.000Z
2021-06-02T00:51:04.000Z
paasta_tools/metrics/metrics_lib.py
eric-erki/An-open-distributed-platform-as-a-service
6769c5601685deb1017910ab8d09109e8e998892
[ "Apache-2.0" ]
null
null
null
import logging import time from abc import ABC from abc import abstractmethod from typing import Any from typing import Callable from typing import Dict from typing import Optional from typing import Type from typing import Union from typing_extensions import Protocol from paasta_tools.utils import load_system_paasta...
29.075758
104
0.683689
import logging import time from abc import ABC from abc import abstractmethod from typing import Any from typing import Callable from typing import Dict from typing import Optional from typing import Type from typing import Union from typing_extensions import Protocol from paasta_tools.utils import load_system_paasta...
true
true
f71a540bc5690d18d0e43343992b3cd169988b23
3,516
py
Python
DDQN.py
TimoleonLatinopoulos/MortalKombatOpenAI
59dc89d1f50dd74690859e5e1fa18701a5246382
[ "MIT" ]
1
2020-08-12T08:16:06.000Z
2020-08-12T08:16:06.000Z
DDQN.py
TimoleonLatinopoulos/MortalKombatOpenAI
59dc89d1f50dd74690859e5e1fa18701a5246382
[ "MIT" ]
null
null
null
DDQN.py
TimoleonLatinopoulos/MortalKombatOpenAI
59dc89d1f50dd74690859e5e1fa18701a5246382
[ "MIT" ]
null
null
null
import tensorflow as tf from keras.activations import relu from keras.initializers import VarianceScaling from keras.layers import Dense, Conv2D, Flatten from keras.losses import logcosh class DDQN: """ Implements a Dueling Dual Deep Q-Network based on the frames of the Retro Environment """ def __init__(sel...
43.95
119
0.674346
import tensorflow as tf from keras.activations import relu from keras.initializers import VarianceScaling from keras.layers import Dense, Conv2D, Flatten from keras.losses import logcosh class DDQN: def __init__(self, n_actions, frame_height=63, frame_width=113, stacked_frames=4, learning_rate=0.00001): ...
true
true
f71a5820fe472212056e6d6abaa0d96203b1f555
939
py
Python
pglast/enums/pg_class.py
fentik/pglast
c4652b3a6098faf26fa8d3a8fd054f23acd72f9c
[ "PostgreSQL" ]
1
2021-08-20T10:09:59.000Z
2021-08-20T10:09:59.000Z
pglast/enums/pg_class.py
fentik/pglast
c4652b3a6098faf26fa8d3a8fd054f23acd72f9c
[ "PostgreSQL" ]
null
null
null
pglast/enums/pg_class.py
fentik/pglast
c4652b3a6098faf26fa8d3a8fd054f23acd72f9c
[ "PostgreSQL" ]
null
null
null
# -*- coding: utf-8 -*- # :Project: pglast -- DO NOT EDIT: automatically extracted from pg_class.h @ 13-2.0.6-0-ga248206 # :Author: Lele Gaifax <lele@metapensiero.it> # :License: GNU General Public License version 3 or later # :Copyright: © 2017-2021 Lele Gaifax # from enum import Enum, IntEnum, IntFlag, auto ...
17.388889
98
0.713525
from enum import Enum, IntEnum, IntFlag, auto try: from enum import StrEnum except ImportError: class StrEnum(str, Enum): pass 'r' RELKIND_INDEX = 'i' RELKIND_SEQUENCE = 'S' RELKIND_TOASTVALUE = 't' RELKIND_VIEW = 'v' RELKIND_MATVIEW = 'm' RELKIND_COMPOSITE_TYPE = 'c' RELKIND_FOR...
true
true
f71a5952c0b0537a3a97b410e481a15d260c9393
7,086
py
Python
d3rlpy/models/torch/encoders.py
meokz/d3rlpy
40504e2d8b424547558ab82786c523e8f4626a82
[ "MIT" ]
2
2021-04-21T08:19:29.000Z
2021-05-17T09:08:06.000Z
d3rlpy/models/torch/encoders.py
meokz/d3rlpy
40504e2d8b424547558ab82786c523e8f4626a82
[ "MIT" ]
null
null
null
d3rlpy/models/torch/encoders.py
meokz/d3rlpy
40504e2d8b424547558ab82786c523e8f4626a82
[ "MIT" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F def _create_activation(activation_type): if activation_type == 'relu': return torch.relu elif activation_type == 'swish': return lambda x: x * torch.sigmoid(x) raise ValueError('invalid activation_type.') def create_encod...
34.565854
75
0.540785
import torch import torch.nn as nn import torch.nn.functional as F def _create_activation(activation_type): if activation_type == 'relu': return torch.relu elif activation_type == 'swish': return lambda x: x * torch.sigmoid(x) raise ValueError('invalid activation_type.') def create_encod...
true
true
f71a5d5dd300e03985a3ca77a605a2e70ab1f462
121,589
py
Python
tests/git_cl_test.py
2youyou2/depot_tools
8b94108e684872a89f7108f51ba74f01220d64fa
[ "BSD-3-Clause" ]
7
2018-09-26T11:10:40.000Z
2020-12-19T13:32:12.000Z
tests/git_cl_test.py
2youyou2/depot_tools
8b94108e684872a89f7108f51ba74f01220d64fa
[ "BSD-3-Clause" ]
null
null
null
tests/git_cl_test.py
2youyou2/depot_tools
8b94108e684872a89f7108f51ba74f01220d64fa
[ "BSD-3-Clause" ]
4
2020-03-27T07:49:45.000Z
2020-11-17T02:46:42.000Z
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for git_cl.py.""" import contextlib import datetime import json import logging import os import StringIO import sys ...
38.759643
80
0.577042
import contextlib import datetime import json import logging import os import StringIO import sys import tempfile import unittest import urlparse sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from testing_support.auto_stub import TestCase import metrics metrics.DISABLE_METRIC...
true
true
f71a5da87d38b68176352916c419991c5e418c42
15,214
py
Python
treebuilder/partptr/train.py
NLP-Discourse-SoochowU/TDDiscourseParser
2f9c7cef85c564c47b368ee4935caf1fad7c598d
[ "Apache-2.0" ]
9
2020-11-24T01:16:01.000Z
2022-01-26T09:37:00.000Z
treebuilder/partptr/train.py
NLP-Discourse-SoochowU/TDDiscourseParser
2f9c7cef85c564c47b368ee4935caf1fad7c598d
[ "Apache-2.0" ]
2
2020-11-29T17:49:49.000Z
2021-05-20T02:53:25.000Z
treebuilder/partptr/train.py
NLP-Discourse-SoochowU/TDDiscourseParser
2f9c7cef85c564c47b368ee4935caf1fad7c598d
[ "Apache-2.0" ]
1
2022-01-26T11:00:33.000Z
2022-01-26T11:00:33.000Z
# coding: UTF-8 import argparse import logging import random import torch import copy import numpy as np from dataset import CDTB from collections import Counter from itertools import chain from structure.vocab import Vocab, Label from structure.nodes import node_type_filter, EDU, Relation, Sentence, TEXT f...
46.95679
121
0.63481
import argparse import logging import random import torch import copy import numpy as np from dataset import CDTB from collections import Counter from itertools import chain from structure.vocab import Vocab, Label from structure.nodes import node_type_filter, EDU, Relation, Sentence, TEXT from treebuilder....
true
true
f71a5e69e97dfd4fa78fe7475a89e51f71597592
2,911
py
Python
migrations/env.py
kvshravan/sample-platform
f3cf050d21df9d8e4b3746a5a32d273d839c4898
[ "0BSD" ]
null
null
null
migrations/env.py
kvshravan/sample-platform
f3cf050d21df9d8e4b3746a5a32d273d839c4898
[ "0BSD" ]
null
null
null
migrations/env.py
kvshravan/sample-platform
f3cf050d21df9d8e4b3746a5a32d273d839c4898
[ "0BSD" ]
null
null
null
from __future__ import with_statement import logging from logging.config import fileConfig from alembic import context # add your model's MetaData object here # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata from flask import current_app from sqlalchemy import engine_...
30.642105
77
0.710752
from __future__ import with_statement import logging from logging.config import fileConfig from alembic import context # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata from flask import current_app from sqlalchemy import engine_from_config, pool # this is the Alembi...
true
true
f71a5f10643eea16f3e9e3317d0eb53ee89dcc29
4,484
py
Python
setup.py
btcdrak/mitmproxy
cacee3871c6a9f0be7127f3c790e09a1daaf8490
[ "MIT" ]
1
2018-03-31T17:16:07.000Z
2018-03-31T17:16:07.000Z
setup.py
btcdrak/mitmproxy
cacee3871c6a9f0be7127f3c790e09a1daaf8490
[ "MIT" ]
null
null
null
setup.py
btcdrak/mitmproxy
cacee3871c6a9f0be7127f3c790e09a1daaf8490
[ "MIT" ]
4
2018-04-18T13:17:01.000Z
2021-02-21T17:08:33.000Z
from setuptools import setup, find_packages from codecs import open import os from netlib import version # Based on https://github.com/pypa/sampleproject/blob/master/setup.py # and https://python-packaging-user-guide.readthedocs.org/ here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'RE...
35.587302
125
0.533898
from setuptools import setup, find_packages from codecs import open import os from netlib import version here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name="mitmproxy", version=version.VERSION, ...
true
true
f71a5f3662e8e2e441c743a6c1f62a562f34d623
2,570
py
Python
homeassistant/components/fibaro/binary_sensor.py
VirtualL/home-assistant
301829d02be8d865ab46c8901ac046d060849320
[ "Apache-2.0" ]
2
2017-10-26T19:43:55.000Z
2017-12-30T23:29:00.000Z
homeassistant/components/fibaro/binary_sensor.py
VirtualL/home-assistant
301829d02be8d865ab46c8901ac046d060849320
[ "Apache-2.0" ]
3
2021-09-08T03:34:57.000Z
2022-03-12T00:59:48.000Z
homeassistant/components/fibaro/binary_sensor.py
VirtualL/home-assistant
301829d02be8d865ab46c8901ac046d060849320
[ "Apache-2.0" ]
1
2019-06-19T07:43:11.000Z
2019-06-19T07:43:11.000Z
"""Support for Fibaro binary sensors.""" import logging from homeassistant.components.binary_sensor import ( ENTITY_ID_FORMAT, BinarySensorDevice) from homeassistant.const import CONF_DEVICE_CLASS, CONF_ICON from . import FIBARO_DEVICES, FibaroDevice DEPENDENCIES = ['fibaro'] _LOGGER = logging.getLogger(__name_...
32.948718
73
0.643191
import logging from homeassistant.components.binary_sensor import ( ENTITY_ID_FORMAT, BinarySensorDevice) from homeassistant.const import CONF_DEVICE_CLASS, CONF_ICON from . import FIBARO_DEVICES, FibaroDevice DEPENDENCIES = ['fibaro'] _LOGGER = logging.getLogger(__name__) SENSOR_TYPES = { 'com.fibaro.floo...
true
true
f71a5f6bde441477b83381af68fd302a858044d3
338
py
Python
fixture_packages/no_mp/setup.py
DuncanBetts/morepath
acad10489b051df9c512f6735a9338854745a599
[ "BSD-3-Clause" ]
null
null
null
fixture_packages/no_mp/setup.py
DuncanBetts/morepath
acad10489b051df9c512f6735a9338854745a599
[ "BSD-3-Clause" ]
null
null
null
fixture_packages/no_mp/setup.py
DuncanBetts/morepath
acad10489b051df9c512f6735a9338854745a599
[ "BSD-3-Clause" ]
null
null
null
import os from setuptools import setup, find_packages setup(name='no_mp', version = '0.1.dev0', description="No Mp Test Fixture", author="Martijn Faassen", author_email="faassen@startifact.com", license="BSD", packages=find_packages(), zip_safe=False, install_requires=[ ...
22.533333
44
0.62426
import os from setuptools import setup, find_packages setup(name='no_mp', version = '0.1.dev0', description="No Mp Test Fixture", author="Martijn Faassen", author_email="faassen@startifact.com", license="BSD", packages=find_packages(), zip_safe=False, install_requires=[ ...
true
true
f71a60c2e83e89f0d85d50940ea141974ce4e00d
5,431
py
Python
homeassistant/components/geo_rss_events/sensor.py
VirtualL/home-assistant
301829d02be8d865ab46c8901ac046d060849320
[ "Apache-2.0" ]
null
null
null
homeassistant/components/geo_rss_events/sensor.py
VirtualL/home-assistant
301829d02be8d865ab46c8901ac046d060849320
[ "Apache-2.0" ]
3
2021-09-08T03:34:57.000Z
2022-03-12T00:59:48.000Z
homeassistant/components/geo_rss_events/sensor.py
VirtualL/home-assistant
301829d02be8d865ab46c8901ac046d060849320
[ "Apache-2.0" ]
null
null
null
""" Generic GeoRSS events service. Retrieves current events (typically incidents or alerts) in GeoRSS format, and shows information on events filtered by distance to the HA instance's location and grouped by category. For more details about this platform, please refer to the documentation at https://home-assistant.io...
35.730263
79
0.645369
import logging from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_UNIT_OF_MEASUREMENT, CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS, CONF_URL) f...
true
true
f71a60d6ac54cd0f6a8035a072455dd7fe920d40
3,670
py
Python
akshare/stock/stock_rank_forecast.py
J-Z-Z/akshare
0a9ca71b381a272e2f56211e455ff2493dfed17a
[ "MIT" ]
721
2021-09-21T12:10:33.000Z
2022-03-31T09:47:01.000Z
akshare/stock/stock_rank_forecast.py
J-Z-Z/akshare
0a9ca71b381a272e2f56211e455ff2493dfed17a
[ "MIT" ]
135
2021-09-21T12:07:54.000Z
2022-03-31T14:15:36.000Z
akshare/stock/stock_rank_forecast.py
J-Z-Z/akshare
0a9ca71b381a272e2f56211e455ff2493dfed17a
[ "MIT" ]
234
2021-09-21T12:16:27.000Z
2022-03-31T09:47:04.000Z
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Date: 2021/9/12 18:29 Desc: 巨潮资讯-数据中心-评级预测-投资评级 http://webapi.cninfo.com.cn/#/thematicStatistics?name=%E6%8A%95%E8%B5%84%E8%AF%84%E7%BA%A7 """ import time from py_mini_racer import py_mini_racer import requests import pandas as pd js_str = """ function mcode(input) ...
33.063063
139
0.495368
import time from py_mini_racer import py_mini_racer import requests import pandas as pd js_str = """ function mcode(input) { var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "="; var output = ""; var chr1, chr...
true
true
f71a61f85926c5c06fd0a3030685cd6256d6daab
7,369
py
Python
coremltools/converters/mil/mil/passes/conv_scale_fusion.py
LaudateCorpus1/coremltools
777a4460d6823e5e91dea4fa3eacb0b11c7d5dfc
[ "BSD-3-Clause" ]
null
null
null
coremltools/converters/mil/mil/passes/conv_scale_fusion.py
LaudateCorpus1/coremltools
777a4460d6823e5e91dea4fa3eacb0b11c7d5dfc
[ "BSD-3-Clause" ]
null
null
null
coremltools/converters/mil/mil/passes/conv_scale_fusion.py
LaudateCorpus1/coremltools
777a4460d6823e5e91dea4fa3eacb0b11c7d5dfc
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2021, Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can be # found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause import numpy as np from coremltools.converters.mil.mil.passes.pass_registry import register_pass fro...
36.122549
140
0.627086
import numpy as np from coremltools.converters.mil.mil.passes.pass_registry import register_pass from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass from coremltools.converters.mil.mil import Builder as mb def _try_to_transform(conv_op, scale_op, block): if scale_op.x.val is...
true
true
f71a6261577109f2928b029f3952cbc9f28b4dcc
997
py
Python
kubernetes/test/test_v1_ceph_fs_volume_source.py
scele/kubernetes-client-python
9e982cbdb5f19dc1a3935a75bdd92288f3b807fb
[ "Apache-2.0" ]
null
null
null
kubernetes/test/test_v1_ceph_fs_volume_source.py
scele/kubernetes-client-python
9e982cbdb5f19dc1a3935a75bdd92288f3b807fb
[ "Apache-2.0" ]
null
null
null
kubernetes/test/test_v1_ceph_fs_volume_source.py
scele/kubernetes-client-python
9e982cbdb5f19dc1a3935a75bdd92288f3b807fb
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
22.155556
105
0.719157
from __future__ import absolute_import import os import sys import unittest import kubernetes.client from kubernetes.client.rest import ApiException from kubernetes.client.models.v1_ceph_fs_volume_source import V1CephFSVolumeSource class TestV1CephFSVolumeSource(unittest.TestCase): def setUp(self): ...
true
true
f71a62b2ff79265703f83e0534fed29f3684b334
14,167
py
Python
notebooks/39.1-BDP-unbiased-clustering.py
zeou1/maggot_models
4e1b518c2981ab1ca9607099c3813e8429d94ca4
[ "BSD-3-Clause" ]
null
null
null
notebooks/39.1-BDP-unbiased-clustering.py
zeou1/maggot_models
4e1b518c2981ab1ca9607099c3813e8429d94ca4
[ "BSD-3-Clause" ]
null
null
null
notebooks/39.1-BDP-unbiased-clustering.py
zeou1/maggot_models
4e1b518c2981ab1ca9607099c3813e8429d94ca4
[ "BSD-3-Clause" ]
null
null
null
# %% [markdown] # # Imports import json import os import warnings from operator import itemgetter from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from joblib import Parallel, delayed from joblib.parallel import Parallel, delayed from sklearn.metrics...
29.150206
88
0.673678
son import os import warnings from operator import itemgetter from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from joblib import Parallel, delayed from joblib.parallel import Parallel, delayed from sklearn.metrics import adjusted_rand_score import ...
true
true
f71a6368df82f8cba23fa6c4aacdc3254b4af1ca
702
py
Python
Cklib/Filter.py
kamphaus/HPCGrunner
1885ee87bf02bab51cc71d560d86217c79c5f46b
[ "MIT" ]
null
null
null
Cklib/Filter.py
kamphaus/HPCGrunner
1885ee87bf02bab51cc71d560d86217c79c5f46b
[ "MIT" ]
null
null
null
Cklib/Filter.py
kamphaus/HPCGrunner
1885ee87bf02bab51cc71d560d86217c79c5f46b
[ "MIT" ]
null
null
null
import copy def filterRemaining(remaining, environment): returned = copy.copy(remaining) for i in range(len(returned)-1, -1, -1): r = returned[i] if any(not(r[e]==environment[e]) for e in environment if e in r): del returned[i] else: runs = copy.copy(r['runs']) ...
30.521739
73
0.474359
import copy def filterRemaining(remaining, environment): returned = copy.copy(remaining) for i in range(len(returned)-1, -1, -1): r = returned[i] if any(not(r[e]==environment[e]) for e in environment if e in r): del returned[i] else: runs = copy.copy(r['runs']) ...
true
true
f71a637927490a1a25d4576addd9a32c1d6e1ce3
2,617
py
Python
acregnet/data.py
luoyi1hao/ACRN_Chest_X-ray_IA
b2ecaf88e6b1bb59101fd2d611bf9d1e6716367a
[ "MIT" ]
1
2021-09-23T10:37:53.000Z
2021-09-23T10:37:53.000Z
acregnet/data.py
luoyi1hao/ACRN_Chest_X-ray_IA
b2ecaf88e6b1bb59101fd2d611bf9d1e6716367a
[ "MIT" ]
null
null
null
acregnet/data.py
luoyi1hao/ACRN_Chest_X-ray_IA
b2ecaf88e6b1bb59101fd2d611bf9d1e6716367a
[ "MIT" ]
null
null
null
import os import numpy as np from sklearn.model_selection import train_test_split import cv2 class DataHandler(object): def _load_data(im_fnames, add_channel_dim=True): im0 = cv2.imread(im_fnames[0], 0) im_batch = np.zeros((len(im_fnames),) + im0.shape) im_batch[0] = im0 for i, fn...
34.893333
76
0.610623
import os import numpy as np from sklearn.model_selection import train_test_split import cv2 class DataHandler(object): def _load_data(im_fnames, add_channel_dim=True): im0 = cv2.imread(im_fnames[0], 0) im_batch = np.zeros((len(im_fnames),) + im0.shape) im_batch[0] = im0 for i, fn...
true
true
f71a63e9f0ba5a8f65374e8816ee7e58d28c35bf
4,706
py
Python
gatenlp/processing/annotator.py
gitter-badger/python-gatenlp
bfed863b404cfd62c98a6cb08ad287c3b4b6ccae
[ "Apache-2.0" ]
null
null
null
gatenlp/processing/annotator.py
gitter-badger/python-gatenlp
bfed863b404cfd62c98a6cb08ad287c3b4b6ccae
[ "Apache-2.0" ]
null
null
null
gatenlp/processing/annotator.py
gitter-badger/python-gatenlp
bfed863b404cfd62c98a6cb08ad287c3b4b6ccae
[ "Apache-2.0" ]
null
null
null
""" Module with the base class and supporting functions for all annotators. Any callable that can be called by passing a document can be used as an annotator, but the base class "Annotator" defined in here is designed to allow for a more flexible approach to do things. """ from abc import ABC, abstractmethod __pdoc__ ...
41.280702
116
0.679558
from abc import ABC, abstractmethod __pdoc__ = {"Annotator.__call__": True} class Annotator(ABC): @abstractmethod def __call__(self, doc, **kwargs): raise Exception("This method must be implemented!") def pipe(self, documents, **kwargs): for el in documents: if el is not Non...
true
true
f71a650b60dea15af020b9d6037cca6aa1d1b85d
3,943
py
Python
muti_thread.py
fanlushuai/jd-assistant
ac9fce2cc87d2a6702743c28d4a3eeb3ee99f9ac
[ "MIT" ]
2
2021-01-13T00:16:30.000Z
2021-01-31T01:34:57.000Z
muti_thread.py
fanlushuai/jd-assistant
ac9fce2cc87d2a6702743c28d4a3eeb3ee99f9ac
[ "MIT" ]
null
null
null
muti_thread.py
fanlushuai/jd-assistant
ac9fce2cc87d2a6702743c28d4a3eeb3ee99f9ac
[ "MIT" ]
1
2020-12-16T12:10:06.000Z
2020-12-16T12:10:06.000Z
import functools import queue import random import time from concurrent.futures import ThreadPoolExecutor from itertools import repeat from log import logger shut_down_pool_queue = queue.Queue() # sys_thread_pool = ThreadPoolExecutor(max_workers=2) def shutdown_listener(): for _ in repeat(None): t_poo...
29.425373
88
0.609942
import functools import queue import random import time from concurrent.futures import ThreadPoolExecutor from itertools import repeat from log import logger shut_down_pool_queue = queue.Queue() def shutdown_listener(): for _ in repeat(None): t_pool = shut_down_pool_queue.get() t_pool.shutdow...
true
true
f71a66863303bb27d7b14ce461ffa23d7ac9b033
534
py
Python
web_api/api/migrations/0103_gateway_mqtt_password.py
IoT-BA/project_noe-backend
4b63b4604dd9f3d53a1bdb6ad8e6ad20fe53ebd9
[ "MIT" ]
2
2017-02-27T07:41:18.000Z
2017-03-05T22:13:39.000Z
web_api/api/migrations/0103_gateway_mqtt_password.py
IoT-BA/lorawan-sk-backend
4b63b4604dd9f3d53a1bdb6ad8e6ad20fe53ebd9
[ "MIT" ]
null
null
null
web_api/api/migrations/0103_gateway_mqtt_password.py
IoT-BA/lorawan-sk-backend
4b63b4604dd9f3d53a1bdb6ad8e6ad20fe53ebd9
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-01-22 09:20 from __future__ import unicode_literals import api.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0102_auto_20170121_2038'), ] operations = [ migration...
24.272727
116
0.651685
from __future__ import unicode_literals import api.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0102_auto_20170121_2038'), ] operations = [ migrations.AddField( model_name='gateway', name='mqtt...
true
true
f71a677c5c16ac76e38db599d0a5eac2507bf63b
747
py
Python
ScriptEngine/app.py
daizhaolin/scriptengine
eb3aee0381193d5550d31b59574ca60a4706cb25
[ "BSD-3-Clause" ]
null
null
null
ScriptEngine/app.py
daizhaolin/scriptengine
eb3aee0381193d5550d31b59574ca60a4706cb25
[ "BSD-3-Clause" ]
null
null
null
ScriptEngine/app.py
daizhaolin/scriptengine
eb3aee0381193d5550d31b59574ca60a4706cb25
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: UTF-8 -*- ''' Created on 2020-03-08 @author: daizhaolin ''' from .config import Config from .helper import cached_property from .logging import create_logger class ScriptEngine(object): def __init__(self): self.name = __name__ self.config = Config({ 'DEBUG': False ...
19.153846
48
0.630522
from .config import Config from .helper import cached_property from .logging import create_logger class ScriptEngine(object): def __init__(self): self.name = __name__ self.config = Config({ 'DEBUG': False }) self.extensions = dict() self.controller_queue = ...
true
true
f71a679ff4b8d5cbe23ab5310c5a07b000075f19
8,622
py
Python
examples/tutorials/advanced/websockets-example-MNIST-parallel/run_websocket_client.py
theoptips/PySyft
4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc
[ "Apache-2.0" ]
1
2019-07-14T01:18:34.000Z
2019-07-14T01:18:34.000Z
examples/tutorials/advanced/websockets-example-MNIST-parallel/run_websocket_client.py
theoptips/PySyft
4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc
[ "Apache-2.0" ]
null
null
null
examples/tutorials/advanced/websockets-example-MNIST-parallel/run_websocket_client.py
theoptips/PySyft
4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc
[ "Apache-2.0" ]
1
2021-02-12T12:11:44.000Z
2021-02-12T12:11:44.000Z
import torch import torch.nn as nn import torch.nn.functional as F from torchvision import transforms, datasets import logging import argparse import sys import asyncio import numpy as np import syft as sy from syft import workers from syft.frameworks.torch.federated import utils logger = logging.getLogger(__name__)...
33.034483
106
0.63164
import torch import torch.nn as nn import torch.nn.functional as F from torchvision import transforms, datasets import logging import argparse import sys import asyncio import numpy as np import syft as sy from syft import workers from syft.frameworks.torch.federated import utils logger = logging.getLogger(__name__)...
true
true
f71a67e87a44037f0e910996ddb201d1c1d0ca36
373
py
Python
Lib/site-packages/spyder/plugins/layout/__init__.py
hirorin-demon/hirorin-streamlit
03fbb6f03ec94f909d451e708a3b30b177607695
[ "0BSD" ]
1
2021-06-20T14:52:40.000Z
2021-06-20T14:52:40.000Z
spyder/plugins/layout/__init__.py
Pancakerr/spyder
34a9878bba97f427fbdd7b4a6d77ac0651327565
[ "MIT" ]
1
2020-11-02T21:11:19.000Z
2020-11-02T21:11:19.000Z
spyder/plugins/layout/__init__.py
Pancakerr/spyder
34a9878bba97f427fbdd7b4a6d77ac0651327565
[ "MIT" ]
1
2020-06-14T07:03:50.000Z
2020-06-14T07:03:50.000Z
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ spyder.plugins.layout ===================== Layout plugin. """ from spyder.plugins.layout.plugin import Layout # The following statement is required to be able...
20.722222
74
0.699732
from spyder.plugins.layout.plugin import Layout PLUGIN_CLASSES = [Layout]
true
true
f71a685556aab5e675c6c3f4e360e0b1d91795d0
5,029
py
Python
nezzle/graphics/arrows/basearrow.py
dwgoon/nezzle
c69d111ae5e57ee2a7db85e14299c23d3b98a6d5
[ "MIT" ]
2
2021-10-06T08:54:02.000Z
2021-10-06T16:17:18.000Z
nezzle/graphics/arrows/basearrow.py
dwgoon/nezzle
c69d111ae5e57ee2a7db85e14299c23d3b98a6d5
[ "MIT" ]
null
null
null
nezzle/graphics/arrows/basearrow.py
dwgoon/nezzle
c69d111ae5e57ee2a7db85e14299c23d3b98a6d5
[ "MIT" ]
null
null
null
from qtpy.QtCore import QPointF from nezzle.utils import TriggerDict class BaseArrow(object): ITEM_TYPE = 'BASE_HEAD' DEFAULT_OFFSET = 4 def __init__(self, width, height, offset): self._attr = TriggerDict() self._attr['ITEM_TYPE'] = self.ITEM_TYPE self._offset = offset ...
26.329843
95
0.611652
from qtpy.QtCore import QPointF from nezzle.utils import TriggerDict class BaseArrow(object): ITEM_TYPE = 'BASE_HEAD' DEFAULT_OFFSET = 4 def __init__(self, width, height, offset): self._attr = TriggerDict() self._attr['ITEM_TYPE'] = self.ITEM_TYPE self._offset = offset ...
true
true
f71a69117f18301e660b95414a5b6b4799351cfc
14,078
py
Python
glance/tests/functional/test_api.py
ilay09/glance
60814cb577401c121d5d786980b3b801be5f4e9e
[ "Apache-2.0" ]
null
null
null
glance/tests/functional/test_api.py
ilay09/glance
60814cb577401c121d5d786980b3b801be5f4e9e
[ "Apache-2.0" ]
null
null
null
glance/tests/functional/test_api.py
ilay09/glance
60814cb577401c121d5d786980b3b801be5f4e9e
[ "Apache-2.0" ]
null
null
null
# Copyright 2012 OpenStack Foundation # 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 requ...
38.359673
78
0.533954
import httplib2 from oslo_serialization import jsonutils from six.moves import http_client from glance.tests import functional class TestApiVersions(functional.FunctionalTest): def test_version_configurations(self): self.start_servers(**self.__dict__.copy()) url = 'htt...
true
true
f71a691a5ad95f1250cb884753aea776f113110d
7,737
py
Python
interface.py
Owiti-Charles/Password-Locker
3e2a0fd883d033fe784af387b52d7360a1157d34
[ "MIT" ]
3
2019-08-31T08:48:15.000Z
2021-12-14T08:21:05.000Z
interface.py
Owiti-Charles/Password-Locker
3e2a0fd883d033fe784af387b52d7360a1157d34
[ "MIT" ]
null
null
null
interface.py
Owiti-Charles/Password-Locker
3e2a0fd883d033fe784af387b52d7360a1157d34
[ "MIT" ]
24
2020-03-09T10:42:17.000Z
2022-02-20T19:25:56.000Z
#!/usr/bin/env python3.6 from passlock import User, Credentials def function(): print(" ____ _____ _ ") print(" | _ \ / ____|| | ") print(" | |_) ) ____ ___ ___ /...
39.676923
217
0.569342
from passlock import User, Credentials def function(): print(" ____ _____ _ ") print(" | _ \ / ____|| | ") print(" | |_) ) ____ ___ ___ / ____ | |__ _____ _...
true
true
f71a697a4e4fb47cb796149291e6b50fd45b68f7
2,233
py
Python
v1.0.0.test/toontown/toon/NPCForceAcknowledge.py
TTOFFLINE-LEAK/ttoffline
bb0e91704a755d34983e94288d50288e46b68380
[ "MIT" ]
4
2019-07-01T15:46:43.000Z
2021-07-23T16:26:48.000Z
v1.0.0.test/toontown/toon/NPCForceAcknowledge.py
TTOFFLINE-LEAK/ttoffline
bb0e91704a755d34983e94288d50288e46b68380
[ "MIT" ]
1
2019-06-29T03:40:05.000Z
2021-06-13T01:15:16.000Z
v1.0.0.test/toontown/toon/NPCForceAcknowledge.py
TTOFFLINE-LEAK/ttoffline
bb0e91704a755d34983e94288d50288e46b68380
[ "MIT" ]
4
2019-07-28T21:18:46.000Z
2021-02-25T06:37:25.000Z
from panda3d.core import * from toontown.toontowngui import TTDialog from toontown.toonbase import TTLocalizer from direct.gui import DirectLabel from toontown.quest import Quests class NPCForceAcknowledge: def __init__(self, doneEvent): self.doneEvent = doneEvent self.dialog = None return...
42.942308
164
0.617555
from panda3d.core import * from toontown.toontowngui import TTDialog from toontown.toonbase import TTLocalizer from direct.gui import DirectLabel from toontown.quest import Quests class NPCForceAcknowledge: def __init__(self, doneEvent): self.doneEvent = doneEvent self.dialog = None return...
true
true
f71a6b6d7ebfa629b63064b6a06dfb7bca79a040
2,157
py
Python
htmltreediff/edit_script_runner.py
nomadicfm/htmltreediff
02a27b2339d5a9a96902eed5d12bca1b755bb109
[ "BSD-3-Clause" ]
3
2015-04-04T20:35:17.000Z
2021-08-06T16:51:09.000Z
htmltreediff/edit_script_runner.py
tex/htmltreediff
ce5a94edd0cfb05ed5130aaed3f06c63668df127
[ "BSD-3-Clause" ]
14
2015-01-15T16:03:14.000Z
2020-03-23T16:29:02.000Z
htmltreediff/edit_script_runner.py
tex/htmltreediff
ce5a94edd0cfb05ed5130aaed3f06c63668df127
[ "BSD-3-Clause" ]
2
2017-05-16T04:17:46.000Z
2018-04-30T20:05:32.000Z
from xml.dom import Node from htmltreediff.util import ( get_child, get_location, remove_node, insert_or_append, ) class EditScriptRunner(object): def __init__(self, dom, edit_script): self.dom = dom self.edit_script = edit_script self.del_nodes = [] self.ins_nodes...
30.814286
69
0.601298
from xml.dom import Node from htmltreediff.util import ( get_child, get_location, remove_node, insert_or_append, ) class EditScriptRunner(object): def __init__(self, dom, edit_script): self.dom = dom self.edit_script = edit_script self.del_nodes = [] self.ins_nodes...
true
true
f71a6bcaeb8ae82f35824738ce05e63e951e4767
4,632
py
Python
archives/src/episode7/he_is_back.py
NovelBox/sherlock-no-adventure
9fe59ade8446d5c27e7bd390de9de42e26fc63a1
[ "MIT" ]
null
null
null
archives/src/episode7/he_is_back.py
NovelBox/sherlock-no-adventure
9fe59ade8446d5c27e7bd390de9de42e26fc63a1
[ "MIT" ]
null
null
null
archives/src/episode7/he_is_back.py
NovelBox/sherlock-no-adventure
9fe59ade8446d5c27e7bd390de9de42e26fc63a1
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ''' Episode 7-3 ''' import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) sys.path.append('storybuilder') from storybuilder.builder.world import World # DEFINE TITLE = "英雄の帰還" # NOTE: outlines ABSTRACT = """ 変身して$sherlockたちを追い詰める$jake。しかし$sherlockの機転で工場に穴を開け、...
44.970874
91
0.655009
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) sys.path.append('storybuilder') from storybuilder.builder.world import World TITLE = "英雄の帰還" ABSTRACT = """ 変身して$sherlockたちを追い詰める$jake。しかし$sherlockの機転で工場に穴を開け、日光を浴びせかけることで$jakeは皮膚から大量に出血し、爆発した。 その爆音を聞いて$limeたちが駆けつける。$maryが身を挺し...
true
true
f71a6d9110d6e2d9754fc6dd198852e4d0c18cb8
14,416
py
Python
tmapi/models/topic_map.py
ajenhl/django-tmapi
02f009e1b508218cf330ca7748c3a1dd110f3e8d
[ "Apache-2.0" ]
2
2015-03-22T03:23:36.000Z
2017-01-08T10:57:18.000Z
tmapi/models/topic_map.py
ajenhl/django-tmapi
02f009e1b508218cf330ca7748c3a1dd110f3e8d
[ "Apache-2.0" ]
null
null
null
tmapi/models/topic_map.py
ajenhl/django-tmapi
02f009e1b508218cf330ca7748c3a1dd110f3e8d
[ "Apache-2.0" ]
1
2020-12-28T04:40:34.000Z
2020-12-28T04:40:34.000Z
# Copyright 2011 Jamie Norrish (jamie@artefact.org.nz) # # 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...
34.821256
77
0.629231
from django.contrib.sites.models import Site from django.db import models from tmapi.exceptions import ModelConstraintException, \ UnsupportedOperationException from tmapi.indices.literal_index import LiteralIndex from tmapi.indices.scoped_index import ScopedIndex from tmapi.indices.type_instance_ind...
true
true
f71a6db30e3de5c2849fe9a5b19812ba331899e0
2,275
py
Python
python-sdk/tutorials/automl-with-azureml/forecasting-recipes-univariate/forecasting_script.py
Ali-ry/azureml-examples
817ae89d2766dcafd70937a22cb3a80f100a2906
[ "MIT" ]
null
null
null
python-sdk/tutorials/automl-with-azureml/forecasting-recipes-univariate/forecasting_script.py
Ali-ry/azureml-examples
817ae89d2766dcafd70937a22cb3a80f100a2906
[ "MIT" ]
null
null
null
python-sdk/tutorials/automl-with-azureml/forecasting-recipes-univariate/forecasting_script.py
Ali-ry/azureml-examples
817ae89d2766dcafd70937a22cb3a80f100a2906
[ "MIT" ]
null
null
null
""" This is the script that is executed on the compute instance. It relies on the model.pkl file which is uploaded along with this script to the compute instance. """ import argparse from azureml.core import Dataset, Run from azureml.automl.core.shared.constants import TimeSeriesInternal from sklearn.external...
32.042254
78
0.744176
import argparse from azureml.core import Dataset, Run from azureml.automl.core.shared.constants import TimeSeriesInternal from sklearn.externals import joblib parser = argparse.ArgumentParser() parser.add_argument( "--target_column_name", type=str, dest="target_column_name", help="Target Co...
true
true
f71a6e91a09965fe94395d5877040ab4bd936107
4,760
py
Python
matching/matching.py
nielsbril/best
8a902293605f1bee1abf3ca66ae3708706658772
[ "MIT" ]
21
2019-07-02T05:54:22.000Z
2021-04-07T13:52:50.000Z
matching/matching.py
nielsbril/best
8a902293605f1bee1abf3ca66ae3708706658772
[ "MIT" ]
55
2019-07-03T18:59:26.000Z
2020-12-15T08:10:00.000Z
matching/matching.py
nielsbril/best
8a902293605f1bee1abf3ca66ae3708706658772
[ "MIT" ]
9
2019-09-10T13:38:46.000Z
2021-09-01T08:02:42.000Z
import pandas as pd import argparse import logging import sys import json def get_best_logger(log_file, verbose): # Setup logger - (Python logger breaks PEP8 by default) logger = logging.getLogger(__name__) if verbose: logger.setLevel('DEBUG') # file_handler logs to file, stream_handler to con...
36.060606
124
0.640336
import pandas as pd import argparse import logging import sys import json def get_best_logger(log_file, verbose): logger = logging.getLogger(__name__) if verbose: logger.setLevel('DEBUG') file_handler = logging.FileHandler(log_file) stream_handler = logging.StreamHandler() f...
true
true
f71a6f98576f957a645a7ce60612e5c8ac44efe1
3,987
py
Python
islykill2/parser.py
sindrig/islykill2
2ad9e0d249637d7bb03a3535f4e054f3570427b2
[ "MIT" ]
1
2019-08-24T23:59:32.000Z
2019-08-24T23:59:32.000Z
islykill2/parser.py
sindrig/islykill2
2ad9e0d249637d7bb03a3535f4e054f3570427b2
[ "MIT" ]
null
null
null
islykill2/parser.py
sindrig/islykill2
2ad9e0d249637d7bb03a3535f4e054f3570427b2
[ "MIT" ]
1
2021-06-25T11:15:23.000Z
2021-06-25T11:15:23.000Z
import os import traceback import base64 import datetime import logging from xml.etree.ElementTree import XML from signxml import xmldsig __all__ = ['AuthenticationError', 'parse_saml'] def decode_response(resp): return base64.b64decode(resp.encode('utf8')) # Getters def get_xmldoc(xmlstring): return XM...
28.683453
79
0.658641
import os import traceback import base64 import datetime import logging from xml.etree.ElementTree import XML from signxml import xmldsig __all__ = ['AuthenticationError', 'parse_saml'] def decode_response(resp): return base64.b64decode(resp.encode('utf8')) def get_xmldoc(xmlstring): return XML(xmlstri...
true
true
f71a703f2090876a8e79cf5a51d2bb5e3344842c
153,793
py
Python
spyke/sort.py
spyke/spyke
20934521de9c557924911cf6190690ac1c6f8e80
[ "CNRI-Python" ]
22
2015-06-01T03:31:00.000Z
2022-03-18T09:12:28.000Z
spyke/sort.py
spyke/spyke
20934521de9c557924911cf6190690ac1c6f8e80
[ "CNRI-Python" ]
3
2017-03-24T19:16:02.000Z
2021-01-27T14:34:30.000Z
spyke/sort.py
spyke/spyke
20934521de9c557924911cf6190690ac1c6f8e80
[ "CNRI-Python" ]
6
2015-07-10T15:28:08.000Z
2022-03-17T19:30:45.000Z
"""Spike sorting classes and window""" from __future__ import division from __future__ import print_function __authors__ = ['Martin Spacek', 'Reza Lotun'] import os import sys import time import datetime from copy import copy import operator import random import shutil import hashlib import multiprocessing as mp fr...
47.437693
98
0.600495
from __future__ import division from __future__ import print_function __authors__ = ['Martin Spacek', 'Reza Lotun'] import os import sys import time import datetime from copy import copy import operator import random import shutil import hashlib import multiprocessing as mp from PyQt4 import QtCore, QtGui from PyQt...
true
true
f71a7085403e8ce0a19e0672e598aeec15a4a023
899
py
Python
examples/show_debug.py
Matuiss2/python-sc2
dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953
[ "MIT" ]
2
2019-01-23T19:11:53.000Z
2019-04-05T17:45:49.000Z
examples/show_debug.py
Matuiss2/python-sc2
dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953
[ "MIT" ]
null
null
null
examples/show_debug.py
Matuiss2/python-sc2
dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953
[ "MIT" ]
1
2019-04-24T13:31:20.000Z
2019-04-24T13:31:20.000Z
import sc2 from sc2 import run_game, maps, Race, Difficulty from sc2.player import Bot, Computer class MyBot(sc2.BotAI): async def on_step(self, iteration): for structure in self.structures: self._client.debug_text_world( "\n".join([ f"{structure.type_id.name...
31
79
0.558398
import sc2 from sc2 import run_game, maps, Race, Difficulty from sc2.player import Bot, Computer class MyBot(sc2.BotAI): async def on_step(self, iteration): for structure in self.structures: self._client.debug_text_world( "\n".join([ f"{structure.type_id.name...
true
true
f71a7119f0a598c0a33db2eb55c1805b7e234b08
21,798
py
Python
archive/reuUpdated.py
emmettmeinzer/hmwgen
cd47733b5a34a6a3a9b56026eb5e73069e398033
[ "MIT" ]
null
null
null
archive/reuUpdated.py
emmettmeinzer/hmwgen
cd47733b5a34a6a3a9b56026eb5e73069e398033
[ "MIT" ]
null
null
null
archive/reuUpdated.py
emmettmeinzer/hmwgen
cd47733b5a34a6a3a9b56026eb5e73069e398033
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Mon Nov 11 13:41:14 2019 @author: Emmett & Binyang """ from pprint import pprint import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer ##Let’s first build a...
38.376761
189
0.708551
from pprint import pprint import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktTrainer text += gutenberg.raw(file_id) print (len(text)) = "" for ele in s: str1 += el...
true
true
f71a71c02c39541a49fbe5ad95d204ca99999495
1,129
py
Python
migrations/versions/0076_add_intl_flag_to_provider.py
cds-snc/notifier-api
90b385ec49efbaee7e607516fc7d9f08991af813
[ "MIT" ]
41
2019-11-28T16:58:41.000Z
2022-01-28T21:11:16.000Z
migrations/versions/0076_add_intl_flag_to_provider.py
cds-snc/notification-api
b1c1064f291eb860b494c3fa65ac256ad70bf47c
[ "MIT" ]
1,083
2019-07-08T12:57:24.000Z
2022-03-08T18:53:40.000Z
migrations/versions/0076_add_intl_flag_to_provider.py
cds-snc/notifier-api
90b385ec49efbaee7e607516fc7d9f08991af813
[ "MIT" ]
9
2020-01-24T19:56:43.000Z
2022-01-27T21:36:53.000Z
"""empty message Revision ID: 0076_add_intl_flag_to_provider Revises: 0075_create_rates_table Create Date: 2017-04-25 09:44:13.194164 """ # revision identifiers, used by Alembic. revision = "0076_add_intl_flag_to_provider" down_revision = "0075_create_rates_table" import sqlalchemy as sa from alembic import op de...
25.659091
104
0.675819
revision = "0076_add_intl_flag_to_provider" down_revision = "0075_create_rates_table" import sqlalchemy as sa from alembic import op def upgrade(): op.add_column( "provider_details", sa.Column( "supports_international", sa.Boolean(), nullable=False, ...
true
true
f71a721c1a9432964c02aa7cb35a51f05080d90d
1,983
py
Python
openbb_terminal/cryptocurrency/onchain/whale_alert_view.py
joshuabuildsthings/GamestonkTerminal
385d12803ae1725a22b0a440c3b88bffa974edcd
[ "MIT" ]
255
2022-03-29T16:43:51.000Z
2022-03-31T23:57:08.000Z
openbb_terminal/cryptocurrency/onchain/whale_alert_view.py
joshuabuildsthings/GamestonkTerminal
385d12803ae1725a22b0a440c3b88bffa974edcd
[ "MIT" ]
14
2022-03-29T14:20:33.000Z
2022-03-31T23:39:20.000Z
openbb_terminal/cryptocurrency/onchain/whale_alert_view.py
joshuabuildsthings/GamestonkTerminal
385d12803ae1725a22b0a440c3b88bffa974edcd
[ "MIT" ]
24
2022-03-29T15:28:56.000Z
2022-03-31T23:54:15.000Z
"""Whale Alert view""" __docformat__ = "numpy" import logging import os from openbb_terminal.cryptocurrency.onchain import whale_alert_model from openbb_terminal.decorators import check_api_key from openbb_terminal.decorators import log_start_end from openbb_terminal.helper_funcs import ( export_data, lambda_...
25.101266
101
0.660111
__docformat__ = "numpy" import logging import os from openbb_terminal.cryptocurrency.onchain import whale_alert_model from openbb_terminal.decorators import check_api_key from openbb_terminal.decorators import log_start_end from openbb_terminal.helper_funcs import ( export_data, lambda_long_number_format, ...
true
true
f71a7324585ada53dbc92d0b00bc1d9b2653e2ad
78,121
py
Python
deepspeed/runtime/engine.py
LatencyTDH/DeepSpeed
eecef309cb12528cfa78d932a6f073afb43847e5
[ "MIT" ]
1
2021-04-21T01:14:32.000Z
2021-04-21T01:14:32.000Z
deepspeed/runtime/engine.py
LatencyTDH/DeepSpeed
eecef309cb12528cfa78d932a6f073afb43847e5
[ "MIT" ]
null
null
null
deepspeed/runtime/engine.py
LatencyTDH/DeepSpeed
eecef309cb12528cfa78d932a6f073afb43847e5
[ "MIT" ]
null
null
null
''' Copyright 2019 The Microsoft DeepSpeed Team ''' import os import stat import torch import warnings import hashlib import torch.distributed as dist from collections import OrderedDict from shutil import copyfile from torch.nn.modules import Module from torch.distributed.distributed_c10d import _get_global_rank fro...
42.735777
227
0.624493
import os import stat import torch import warnings import hashlib import torch.distributed as dist from collections import OrderedDict from shutil import copyfile from torch.nn.modules import Module from torch.distributed.distributed_c10d import _get_global_rank from tensorboardX import SummaryWriter from deepspeed....
true
true
f71a744b58bcf58f5653e87192017fca4a93e074
580
py
Python
code/py/test_statsrecorder.py
notmatthancock/notmatthancock.github.io
abcd91cc7c2653c5243fe96ba2fd681ec03930bb
[ "MIT" ]
null
null
null
code/py/test_statsrecorder.py
notmatthancock/notmatthancock.github.io
abcd91cc7c2653c5243fe96ba2fd681ec03930bb
[ "MIT" ]
null
null
null
code/py/test_statsrecorder.py
notmatthancock/notmatthancock.github.io
abcd91cc7c2653c5243fe96ba2fd681ec03930bb
[ "MIT" ]
null
null
null
import numpy as np import statsrecorder as sr rs = np.random.RandomState(323) mystats = sr.StatsRecorder() # Hold all observations in "data" to check for correctness. ndims = 42 data = np.empty((0, ndims)) for i in range(1000): nobserv = rs.randint(10,101) newdata = rs.randn(nobserv, ndims) data = np.vs...
25.217391
62
0.705172
import numpy as np import statsrecorder as sr rs = np.random.RandomState(323) mystats = sr.StatsRecorder() ndims = 42 data = np.empty((0, ndims)) for i in range(1000): nobserv = rs.randint(10,101) newdata = rs.randn(nobserv, ndims) data = np.vstack((data, newdata)) mystats.update(newdata) ...
true
true
f71a746bad402ab1d91d173ac40a919ce1f67c52
40,695
py
Python
sscanss/ui/dialogs/insert.py
samtygier-stfc/SScanSS-2
0df2160c32fdc533f7d391735bd55d524e253f4d
[ "BSD-3-Clause" ]
null
null
null
sscanss/ui/dialogs/insert.py
samtygier-stfc/SScanSS-2
0df2160c32fdc533f7d391735bd55d524e253f4d
[ "BSD-3-Clause" ]
null
null
null
sscanss/ui/dialogs/insert.py
samtygier-stfc/SScanSS-2
0df2160c32fdc533f7d391735bd55d524e253f4d
[ "BSD-3-Clause" ]
null
null
null
import numpy as np from PyQt5 import QtCore, QtGui, QtWidgets from sscanss.config import path_for, settings from sscanss.core.math import Plane, Matrix33, Vector3, clamp, map_range, trunc, VECTOR_EPS from sscanss.core.geometry import mesh_plane_intersection from sscanss.core.util import Primitives, DockFlag, StrainComp...
44.966851
115
0.672589
import numpy as np from PyQt5 import QtCore, QtGui, QtWidgets from sscanss.config import path_for, settings from sscanss.core.math import Plane, Matrix33, Vector3, clamp, map_range, trunc, VECTOR_EPS from sscanss.core.geometry import mesh_plane_intersection from sscanss.core.util import Primitives, DockFlag, StrainComp...
true
true
f71a74d3749d44e5926e7af02f116135904cbcf5
3,574
py
Python
src/vacuum/webserver.py
nesyamun/vacuum
e58c24e4ff9f88d674e75b17a96c705d88189422
[ "MIT" ]
2
2021-03-15T15:44:23.000Z
2021-04-08T20:58:24.000Z
src/vacuum/webserver.py
nesyamun/vacuum
e58c24e4ff9f88d674e75b17a96c705d88189422
[ "MIT" ]
null
null
null
src/vacuum/webserver.py
nesyamun/vacuum
e58c24e4ff9f88d674e75b17a96c705d88189422
[ "MIT" ]
3
2021-03-15T15:44:37.000Z
2022-03-05T03:44:23.000Z
from asyncio import AbstractEventLoop, Task, get_event_loop from dataclasses import asdict from datetime import datetime from functools import wraps from typing import Callable, Optional, Tuple from quart import Quart, request from werkzeug.exceptions import HTTPException from .config import config from .logger impor...
25.528571
81
0.592334
from asyncio import AbstractEventLoop, Task, get_event_loop from dataclasses import asdict from datetime import datetime from functools import wraps from typing import Callable, Optional, Tuple from quart import Quart, request from werkzeug.exceptions import HTTPException from .config import config from .logger impor...
true
true
f71a75c9c5f86132584053248cbb481ec3e2449c
6,138
py
Python
poetry/console/config/application_config.py
michielboekhoff/poetry
92b1e61c45f13868ffab663fa3e9be2e26e8c368
[ "MIT" ]
null
null
null
poetry/console/config/application_config.py
michielboekhoff/poetry
92b1e61c45f13868ffab663fa3e9be2e26e8c368
[ "MIT" ]
null
null
null
poetry/console/config/application_config.py
michielboekhoff/poetry
92b1e61c45f13868ffab663fa3e9be2e26e8c368
[ "MIT" ]
null
null
null
import logging from cleo.config import ApplicationConfig as BaseApplicationConfig from clikit.api.event import PRE_HANDLE from clikit.api.event import PreHandleEvent from clikit.api.formatter import Style from clikit.api.io import Input from clikit.api.io import InputStream from clikit.api.io import Output from clikit...
34.677966
86
0.655914
import logging from cleo.config import ApplicationConfig as BaseApplicationConfig from clikit.api.event import PRE_HANDLE from clikit.api.event import PreHandleEvent from clikit.api.formatter import Style from clikit.api.io import Input from clikit.api.io import InputStream from clikit.api.io import Output from clikit...
true
true
f71a76296b3a7b1e16734137964be646122469c5
8,766
py
Python
userbot/__init__.py
PratikGoswamiPM/OpenUserBot
1ba7845522a5d5619d2705421a303aa82ce35abb
[ "Naumen", "Condor-1.1", "MS-PL" ]
1
2021-07-18T06:57:28.000Z
2021-07-18T06:57:28.000Z
userbot/__init__.py
PratikGoswamiPM/OpenUserBot
1ba7845522a5d5619d2705421a303aa82ce35abb
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
userbot/__init__.py
PratikGoswamiPM/OpenUserBot
1ba7845522a5d5619d2705421a303aa82ce35abb
[ "Naumen", "Condor-1.1", "MS-PL" ]
null
null
null
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # # thanks to penn5 for bug fixing """ Userbot initialization. """ import os from sys import version_info from logging ...
31.876364
143
0.722222
import os from sys import version_info from logging import basicConfig, getLogger, INFO, DEBUG from distutils.util import strtobool as sb from pymongo import MongoClient from redis import StrictRedis from pylast import LastFMNetwork, md5 from pySmartDL import SmartDL from dotenv import load_dotenv from requests...
true
true
f71a763946c4caf38418e8a819b9202fc549a816
15,744
py
Python
superset/connectors/druid/views.py
whelan9453/incubator-superset
4e3cea45a5136a28442eea50fddc6cf423a9ddd5
[ "Apache-2.0" ]
null
null
null
superset/connectors/druid/views.py
whelan9453/incubator-superset
4e3cea45a5136a28442eea50fddc6cf423a9ddd5
[ "Apache-2.0" ]
2
2019-11-11T11:16:32.000Z
2019-12-13T07:12:09.000Z
superset/connectors/druid/views.py
whelan9453/incubator-superset
4e3cea45a5136a28442eea50fddc6cf423a9ddd5
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
34.151844
85
0.624111
import json import logging from datetime import datetime from flask import flash, Markup, redirect from flask_appbuilder import CompactCRUDMixin, expose from flask_appbuilder.fieldwidgets import Select2Widget from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_appbuilder.securi...
true
true
f71a774da43e92d9a5b2ea6f28b39201e558710f
2,045
py
Python
speech_recognition.py
pmaen/biopython
b6cafe09b3670762d0768cbf2df36fb21b4bd5af
[ "MIT" ]
1
2020-12-24T13:06:31.000Z
2020-12-24T13:06:31.000Z
speech_recognition.py
pmaen/biopython
b6cafe09b3670762d0768cbf2df36fb21b4bd5af
[ "MIT" ]
null
null
null
speech_recognition.py
pmaen/biopython
b6cafe09b3670762d0768cbf2df36fb21b4bd5af
[ "MIT" ]
null
null
null
import os.path import speech_recognition as sr import moviepy.editor as mp from pydub import AudioSegment from pydub.utils import make_chunks import time import glob import re import math from pathlib import Path import soundfile as sf lang = input("Please choose the language for voice recognition by language code. (d...
31.953125
101
0.681174
import os.path import speech_recognition as sr import moviepy.editor as mp from pydub import AudioSegment from pydub.utils import make_chunks import time import glob import re import math from pathlib import Path import soundfile as sf lang = input("Please choose the language for voice recognition by language code. (d...
true
true
f71a77a49def227a97ac06d0cce2532e8e039b8f
2,042
py
Python
code/game/goldspinner.py
LordZagreus/LodeRunner
68aab36be47cabe31e52f3ee43520bdafcdf3c95
[ "MIT" ]
1
2017-10-31T22:26:22.000Z
2017-10-31T22:26:22.000Z
code/game/goldspinner.py
team-sparrow/LodeRunner
68aab36be47cabe31e52f3ee43520bdafcdf3c95
[ "MIT" ]
2
2019-07-05T03:17:18.000Z
2019-07-08T16:15:29.000Z
code/game/goldspinner.py
team-sparrow/LodeRunner
68aab36be47cabe31e52f3ee43520bdafcdf3c95
[ "MIT" ]
1
2020-10-15T09:03:20.000Z
2020-10-15T09:03:20.000Z
import math from particle import Particle #from glfunctions import draw_sprite from code.constants.common import GOLD_SPINNER_LIFESPAN, TILE_WIDTH, TILE_HEIGHT from code.controllers.intervalcontroller import IntervalController class GoldSpinner(Particle): def __init__(self, x, y, dest_x, dest_y): Par...
31.90625
229
0.639079
import math from particle import Particle from code.constants.common import GOLD_SPINNER_LIFESPAN, TILE_WIDTH, TILE_HEIGHT from code.controllers.intervalcontroller import IntervalController class GoldSpinner(Particle): def __init__(self, x, y, dest_x, dest_y): Particle.__init__(self, x, y, 0, 0, 0) ...
true
true
f71a77c1632e053843e6fa96b6402b20781b54ae
561
py
Python
audiovisual/indico_audiovisual/blueprint.py
pferreir/indico-plugins-cern
0fc2eb6b1aa3c3083a813477886a6632f148a4d9
[ "MIT" ]
null
null
null
audiovisual/indico_audiovisual/blueprint.py
pferreir/indico-plugins-cern
0fc2eb6b1aa3c3083a813477886a6632f148a4d9
[ "MIT" ]
null
null
null
audiovisual/indico_audiovisual/blueprint.py
pferreir/indico-plugins-cern
0fc2eb6b1aa3c3083a813477886a6632f148a4d9
[ "MIT" ]
null
null
null
# This file is part of the CERN Indico plugins. # Copyright (C) 2014 - 2019 CERN # # The CERN Indico plugins are free software; you can redistribute # them and/or modify them under the terms of the MIT License; see # the LICENSE file for more details. from __future__ import unicode_literals from indico.core.plugins i...
33
93
0.798574
from __future__ import unicode_literals from indico.core.plugins import IndicoPluginBlueprint from indico_audiovisual.controllers import RHRequestList blueprint = IndicoPluginBlueprint('audiovisual', __name__, url_prefix='/service/audiovisual') blueprint.add_url_rule('/', 'request_list', RHRequestList)
true
true
f71a787e6cf602bff2ff9c173e3363f87c7e53c4
42,908
py
Python
ForgeSVN/forgesvn/tests/model/test_repository.py
rohankumardubey/allura
9c490a051ca912d28b81ce656441d6fed100cb24
[ "Apache-2.0" ]
113
2015-03-25T10:33:37.000Z
2022-02-16T20:55:06.000Z
ForgeSVN/forgesvn/tests/model/test_repository.py
rohankumardubey/allura
9c490a051ca912d28b81ce656441d6fed100cb24
[ "Apache-2.0" ]
4
2017-08-04T16:19:07.000Z
2020-06-08T19:01:33.000Z
ForgeSVN/forgesvn/tests/model/test_repository.py
rohankumardubey/allura
9c490a051ca912d28b81ce656441d6fed100cb24
[ "Apache-2.0" ]
36
2015-08-14T16:27:39.000Z
2022-02-16T20:54:35.000Z
# coding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License...
37.837743
119
0.53969
from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import os import shutil import unittest from unittest import skipUnless import pkg_resources from itertools import count, product from datetime import datetime from zipfile import ZipF...
true
true
f71a788ec1af6202640b3afb171e260ba38421a6
18,525
py
Python
lib/spack/spack/cmd/install.py
padamson/spack
d3f67a48552691b4846ccc4a10f76740b154090c
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
lib/spack/spack/cmd/install.py
padamson/spack
d3f67a48552691b4846ccc4a10f76740b154090c
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
11
2021-03-15T09:26:41.000Z
2022-02-28T15:08:23.000Z
lib/spack/spack/cmd/install.py
padamson/spack
d3f67a48552691b4846ccc4a10f76740b154090c
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import argparse import os import shutil import sys import textwrap import llnl.util.filesystem as fs import llnl.util.tty...
39.33121
80
0.601404
import argparse import os import shutil import sys import textwrap import llnl.util.filesystem as fs import llnl.util.tty as tty import spack.build_environment import spack.cmd import spack.cmd.common.arguments as arguments import spack.environment as ev import spack.fetch_strategy import spack.monitor import sp...
true
true
f71a7a522882e618e8873734efaa5c00541a1526
2,196
py
Python
onnx/backend/test/case/node/batchnorm.py
cnheider/onnx
8e9c7d57f7c5aa6f6eb7ee7abb0ba2a243781933
[ "MIT" ]
137
2020-04-28T12:28:32.000Z
2022-03-18T10:48:25.000Z
onnx/backend/test/case/node/batchnorm.py
cnheider/onnx
8e9c7d57f7c5aa6f6eb7ee7abb0ba2a243781933
[ "MIT" ]
24
2020-05-06T08:06:42.000Z
2021-12-31T07:46:13.000Z
Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/backend/test/case/node/batchnorm.py
lablup/training_results_v0.7
f5bb59aa0f8b18b602763abe47d1d24d0d54b197
[ "Apache-2.0" ]
51
2019-07-12T05:10:25.000Z
2021-07-28T16:19:06.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np # type: ignore import onnx from ..base import Base from . import expect class BatchNormalization(Base): @staticmethod def export(): # typ...
34.857143
86
0.551002
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import onnx from ..base import Base from . import expect class BatchNormalization(Base): @staticmethod def export(): def _batch...
true
true
f71a7adb1bcafed077beb9dfb10755cea07d0e0b
1,239
py
Python
examples/example.py
Mizux/cmake-pybind11
d3b89746546734990eae5a86532674bf3462a2f3
[ "Apache-2.0" ]
null
null
null
examples/example.py
Mizux/cmake-pybind11
d3b89746546734990eae5a86532674bf3462a2f3
[ "Apache-2.0" ]
null
null
null
examples/example.py
Mizux/cmake-pybind11
d3b89746546734990eae5a86532674bf3462a2f3
[ "Apache-2.0" ]
null
null
null
import cmakepybind11 from cmakepybind11.foo import pyFoo from cmakepybind11.bar import pyBar from cmakepybind11.foobar import pyFooBar print(f'version: {cmakepybind11.__version__}') # foo print(f'Foo: {dir(pyFoo.Foo)}') pyFoo.free_function(2147483647) # max int pyFoo.free_function(2147483647+1) # max int + 1 f = py...
21.736842
50
0.736885
import cmakepybind11 from cmakepybind11.foo import pyFoo from cmakepybind11.bar import pyBar from cmakepybind11.foobar import pyFooBar print(f'version: {cmakepybind11.__version__}') print(f'Foo: {dir(pyFoo.Foo)}') pyFoo.free_function(2147483647) pyFoo.free_function(2147483647+1) f = pyFoo.Foo() print(f'class Foo...
true
true
f71a7b8e9aca170c7b5bfc6407b13285000df309
19,338
py
Python
.history/implementations/pixelda/pixelda_20190101224024.py
Napkin-DL/PyTorch-GAN
4668fb434a74a4e4771631944e4abfb0ec1c8795
[ "MIT" ]
null
null
null
.history/implementations/pixelda/pixelda_20190101224024.py
Napkin-DL/PyTorch-GAN
4668fb434a74a4e4771631944e4abfb0ec1c8795
[ "MIT" ]
null
null
null
.history/implementations/pixelda/pixelda_20190101224024.py
Napkin-DL/PyTorch-GAN
4668fb434a74a4e4771631944e4abfb0ec1c8795
[ "MIT" ]
null
null
null
import argparse import os import numpy as np import math import itertools import torchvision.transforms as transforms from torchvision.utils import save_image from torch.utils.data import DataLoader from torchvision import datasets from torch.autograd import Variable from mnistm import MNISTM import torch.nn as nn ...
37.917647
145
0.631554
import argparse import os import numpy as np import math import itertools import torchvision.transforms as transforms from torchvision.utils import save_image from torch.utils.data import DataLoader from torchvision import datasets from torch.autograd import Variable from mnistm import MNISTM import torch.nn as nn ...
true
true
f71a7bc3530cae6fe552775aa2d6f0317c406877
481
py
Python
ocean_utils/http_requests/requests_session.py
oceanprotocol/common-utils-py
f577f4762841496584e114baaec0d476e73c700e
[ "Apache-2.0" ]
1
2020-12-02T13:49:43.000Z
2020-12-02T13:49:43.000Z
common_utils_py/http_requests/requests_session.py
nevermined-io/common-utils-py
4a02843d4f4771935b6f057badac844fef6f6f13
[ "Apache-2.0" ]
2
2021-08-24T13:14:47.000Z
2021-12-01T17:06:29.000Z
common_utils_py/http_requests/requests_session.py
nevermined-io/common-utils-py
4a02843d4f4771935b6f057badac844fef6f6f13
[ "Apache-2.0" ]
null
null
null
import requests from requests.adapters import HTTPAdapter def get_requests_session(): """ Set connection pool maxsize and block value to avoid `connection pool full` warnings. :return: requests session """ session = requests.sessions.Session() session.mount('http://', HTTPAdapter(pool_connect...
32.066667
97
0.738046
import requests from requests.adapters import HTTPAdapter def get_requests_session(): session = requests.sessions.Session() session.mount('http://', HTTPAdapter(pool_connections=25, pool_maxsize=25, pool_block=True)) session.mount('https://', HTTPAdapter(pool_connections=25, pool_maxsize=25, pool_block=Tr...
true
true
f71a7d056b1aa807f43b720faed6745239c9c75f
1,872
py
Python
app.py
ssvfx41/tk-houdini-geometrynode
03454d3c6773b0a48531ab24ace60928f11c4a4e
[ "MIT" ]
null
null
null
app.py
ssvfx41/tk-houdini-geometrynode
03454d3c6773b0a48531ab24ace60928f11c4a4e
[ "MIT" ]
null
null
null
app.py
ssvfx41/tk-houdini-geometrynode
03454d3c6773b0a48531ab24ace60928f11c4a4e
[ "MIT" ]
null
null
null
# Copyright (c) 2015 Pixomondo # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the MIT License included in this # distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the MIT License. All rights # not expressly grante...
33.428571
81
0.6875
import sgtk class GeometryOutputNode(sgtk.platform.Application): def init_app(self): module = self.import_module("tk_houdini_geometrynode") self.handler = module.ToolkitGeometryNodeHandler(self) def convert_to_geometry_nodes(self): self.handler.convert_sg_to_geometry_nodes(...
true
true
f71a7ea56d84335a1f6f15af7d71e033e8ced3a1
996
py
Python
tests/test_inference.py
weiyx16/mmsegmentation
6d35d76195f173fbc6b119a7d7815e67d78024c6
[ "Apache-2.0" ]
21
2022-01-11T14:06:25.000Z
2022-03-29T06:42:13.000Z
tests/test_inference.py
weiyx16/mmsegmentation
6d35d76195f173fbc6b119a7d7815e67d78024c6
[ "Apache-2.0" ]
13
2022-02-15T20:05:18.000Z
2022-02-15T20:05:21.000Z
tests/test_inference.py
weiyx16/mmsegmentation
6d35d76195f173fbc6b119a7d7815e67d78024c6
[ "Apache-2.0" ]
11
2022-01-11T16:05:24.000Z
2022-03-17T01:58:52.000Z
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import mmcv from mmseg.apis import inference_segmentor, init_segmentor def test_test_time_augmentation_on_cpu(): config_file = 'configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py' config = mmcv.Config.fromfile(config_file) # Rem...
32.129032
75
0.73494
import os.path as osp import mmcv from mmseg.apis import inference_segmentor, init_segmentor def test_test_time_augmentation_on_cpu(): config_file = 'configs/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes.py' config = mmcv.Config.fromfile(config_file) config.model.pretrained = None norm_cf...
true
true
f71a801eee241a74789c0995cf4813e2cdb9335f
19,958
py
Python
sdks/python/apache_beam/io/gcp/datastore/v1new/datastoreio.py
RusOr10n/beam
ede14d4aa7d239f74d5565a28a7c4433eaaa7d47
[ "Apache-2.0" ]
1
2019-12-05T04:36:46.000Z
2019-12-05T04:36:46.000Z
sdks/python/apache_beam/io/gcp/datastore/v1new/datastoreio.py
RusOr10n/beam
ede14d4aa7d239f74d5565a28a7c4433eaaa7d47
[ "Apache-2.0" ]
14
2020-02-12T22:20:41.000Z
2021-11-09T19:41:23.000Z
sdks/python/apache_beam/io/gcp/datastore/v1new/datastoreio.py
violalyu/beam
dd605e568d70b1a6ebea60c15b2aec3e240f3914
[ "Apache-2.0" ]
null
null
null
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
38.980469
80
0.702225
from __future__ import absolute_import from __future__ import division import logging import time from builtins import round from apache_beam import typehints from apache_beam.io.gcp.datastore.v1 import util from apache_beam.io.gcp.datastore.v1.adaptive_throttler import AdaptiveThrottler from apache_...
true
true
f71a808666b13ce290442e22bb59d1788d36b370
1,950
py
Python
tools/find_run_binary.py
pospx/external_skia
7a135275c9fc2a4b3cbdcf9a96e7102724752234
[ "BSD-3-Clause" ]
6,304
2015-01-05T23:45:12.000Z
2022-03-31T09:48:13.000Z
third_party/skia/tools/find_run_binary.py
w4454962/miniblink49
b294b6eacb3333659bf7b94d670d96edeeba14c0
[ "Apache-2.0" ]
459
2016-09-29T00:51:38.000Z
2022-03-07T14:37:46.000Z
third_party/skia/tools/find_run_binary.py
w4454962/miniblink49
b294b6eacb3333659bf7b94d670d96edeeba14c0
[ "Apache-2.0" ]
1,231
2015-01-05T03:17:39.000Z
2022-03-31T22:54:58.000Z
#!/usr/bin/python # Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module that finds and runs a binary by looking in the likely locations.""" import os import subprocess import sys def run_comman...
31.451613
77
0.615385
import os import subprocess import sys def run_command(args): proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = proc.communicate() if proc.returncode is not 0: raise Exception('command "%s" failed: %s' ...
true
true
f71a80a3465b00ac689f97b6980266f31c3f42cb
1,463
py
Python
medium/binary-tree-level-order-traversal.py
therealabdi2/LeetcodeQuestions
4c45ee836482a2c7b59906f7a7a99b5b3fa17317
[ "MIT" ]
null
null
null
medium/binary-tree-level-order-traversal.py
therealabdi2/LeetcodeQuestions
4c45ee836482a2c7b59906f7a7a99b5b3fa17317
[ "MIT" ]
null
null
null
medium/binary-tree-level-order-traversal.py
therealabdi2/LeetcodeQuestions
4c45ee836482a2c7b59906f7a7a99b5b3fa17317
[ "MIT" ]
null
null
null
''' Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[3],[9,20],[15,7]] Example 2: Input: root = [1] Output: [[1]] Example 3: Input: root = [] Output: [] ''' # Definition...
22.859375
87
0.548189
import collections from collections import deque from typing import Optional, List class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def levelOrder(self, root: Optional[TreeNode]) -> List[List[int]]:...
true
true
f71a8102f3baad74119a666239cf334a1a7047ff
23,415
py
Python
sfa_dash/conftest.py
lboeman/solarforecastarbiter_dashboard
cd4dcffa922625b548d93f83be2b7c10457e1bbe
[ "MIT" ]
4
2020-06-02T01:40:40.000Z
2021-06-01T20:15:00.000Z
sfa_dash/conftest.py
lboeman/solarforecastarbiter_dashboard
cd4dcffa922625b548d93f83be2b7c10457e1bbe
[ "MIT" ]
181
2020-05-14T15:42:55.000Z
2021-12-02T20:27:44.000Z
sfa_dash/conftest.py
lboeman/solarforecastarbiter_dashboard
cd4dcffa922625b548d93f83be2b7c10457e1bbe
[ "MIT" ]
2
2018-11-02T19:32:16.000Z
2018-11-06T17:06:28.000Z
import os import requests import pymysql import pytest from flask import url_for from solarforecastarbiter.datamodel import QualityFlagFilter as QFF from sfa_dash import create_app BASE_URL = 'http://localhost' resample_threshold = QFF.resample_threshold_percentage @pytest.fixture(scope='session') def auth_toke...
33.690647
2,216
0.658808
import os import requests import pymysql import pytest from flask import url_for from solarforecastarbiter.datamodel import QualityFlagFilter as QFF from sfa_dash import create_app BASE_URL = 'http://localhost' resample_threshold = QFF.resample_threshold_percentage @pytest.fixture(scope='session') def auth_toke...
true
true
f71a810dff951c596883e731538ad5809e7693d4
676
py
Python
pyutilscr/check.py
GoodMusic8596/pyutilscr
5965d3ab66767e2ef14ab119739b673859bbab81
[ "MIT" ]
1
2021-12-25T16:09:41.000Z
2021-12-25T16:09:41.000Z
pyutilscr/check.py
GoodMusic8596/pyutilscr
5965d3ab66767e2ef14ab119739b673859bbab81
[ "MIT" ]
null
null
null
pyutilscr/check.py
GoodMusic8596/pyutilscr
5965d3ab66767e2ef14ab119739b673859bbab81
[ "MIT" ]
null
null
null
import glob def search(directory, searchElem:list, extension = ".txt"): """Searches files in a specified directory and checks if they contain the specified elements. directory format: /home/runner/project directory type: folder element type: list extensions requirments: MUST have a period bef...
28.166667
94
0.690828
import glob def search(directory, searchElem:list, extension = ".txt"): files = glob.glob(directory+"*"+extension) files_detected = [] for file in files: sf = open(file) stored = sf.read() for elem in searchElem: if elem in stored: files_detected.append(file) return files_detected
true
true
f71a812d7ff386f03ab0d70d638640016bdd2c44
3,007
py
Python
air_pollution_death_rate_related/scripts/air_pollution/predict_aqi.py
nghitrampham/air_pollution_death_rate_related
3fd72b9684e8362de5706ba37c1d90b844d4afe0
[ "MIT" ]
null
null
null
air_pollution_death_rate_related/scripts/air_pollution/predict_aqi.py
nghitrampham/air_pollution_death_rate_related
3fd72b9684e8362de5706ba37c1d90b844d4afe0
[ "MIT" ]
15
2019-12-10T02:05:58.000Z
2022-03-12T00:06:38.000Z
air_pollution_death_rate_related/scripts/air_pollution/predict_aqi.py
nghitrampham/CSE583_FinalProject
3fd72b9684e8362de5706ba37c1d90b844d4afe0
[ "MIT" ]
1
2020-06-04T17:48:21.000Z
2020-06-04T17:48:21.000Z
""" This module is used to predict the Air Quality Index model for 2019 for all counties. """ import pickle import warnings import pandas as pd import numpy as np from keras.models import load_model import helpers warnings.filterwarnings("ignore") def main(): data2019_raw = pd.read_csv("""air_pollution_death_r...
36.228916
96
0.606252
import pickle import warnings import pandas as pd import numpy as np from keras.models import load_model import helpers warnings.filterwarnings("ignore") def main(): data2019_raw = pd.read_csv("""air_pollution_death_rate_related/data/air_pollution/ data_air_raw/daily_aqi_by_coun...
true
true
f71a8190b09e04bc1e4e8dc5cf8762becc12f3bd
2,108
py
Python
office365/directory/identities/userflows/language_configuration.py
juguerre/Office365-REST-Python-Client
dbadaddb14e7bad199499c898cdef1ada9694fc9
[ "MIT" ]
null
null
null
office365/directory/identities/userflows/language_configuration.py
juguerre/Office365-REST-Python-Client
dbadaddb14e7bad199499c898cdef1ada9694fc9
[ "MIT" ]
null
null
null
office365/directory/identities/userflows/language_configuration.py
juguerre/Office365-REST-Python-Client
dbadaddb14e7bad199499c898cdef1ada9694fc9
[ "MIT" ]
null
null
null
from office365.directory.identities.userflows.language_page import UserFlowLanguagePage from office365.entity import Entity from office365.entity_collection import EntityCollection from office365.runtime.resource_path import ResourcePath class UserFlowLanguageConfiguration(Entity): """Allows a user flow to suppor...
41.333333
113
0.65797
from office365.directory.identities.userflows.language_page import UserFlowLanguagePage from office365.entity import Entity from office365.entity_collection import EntityCollection from office365.runtime.resource_path import ResourcePath class UserFlowLanguageConfiguration(Entity): @property def display_name...
true
true
f71a821c13b082b4b5b3c1c3dd849583b82123e0
4,830
py
Python
detect_secrets/core/baseline.py
paulo-sampaio/detect-secrets
73ffbc35a72cb316d9e1842cc131b6098cf3c36a
[ "Apache-2.0" ]
2,212
2018-04-03T20:58:42.000Z
2022-03-31T17:58:38.000Z
detect_secrets/core/baseline.py
paulo-sampaio/detect-secrets
73ffbc35a72cb316d9e1842cc131b6098cf3c36a
[ "Apache-2.0" ]
354
2018-04-03T16:29:55.000Z
2022-03-31T18:26:26.000Z
detect_secrets/core/baseline.py
paulo-sampaio/detect-secrets
73ffbc35a72cb316d9e1842cc131b6098cf3c36a
[ "Apache-2.0" ]
298
2018-04-02T19:35:15.000Z
2022-03-28T04:52:14.000Z
import json import time from typing import Any from typing import Callable from typing import cast from typing import Dict from typing import List from typing import Optional from typing import Union from . import upgrades from ..__version__ import VERSION from ..exceptions import UnableToReadBaselineError from ..sett...
32.635135
97
0.69089
import json import time from typing import Any from typing import Callable from typing import cast from typing import Dict from typing import List from typing import Optional from typing import Union from . import upgrades from ..__version__ import VERSION from ..exceptions import UnableToReadBaselineError from ..sett...
true
true
f71a825a050d1c91553d9c34bfd983037a77f740
1,367
py
Python
app/core/tests/test_admin.py
tarcisioLima/recipe-app-api
62e5dfa49c0b4bd400454e78d0c0bea673f32f58
[ "MIT" ]
null
null
null
app/core/tests/test_admin.py
tarcisioLima/recipe-app-api
62e5dfa49c0b4bd400454e78d0c0bea673f32f58
[ "MIT" ]
null
null
null
app/core/tests/test_admin.py
tarcisioLima/recipe-app-api
62e5dfa49c0b4bd400454e78d0c0bea673f32f58
[ "MIT" ]
null
null
null
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): """A funcion that executes before all tests""" def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_supe...
31.790698
68
0.640088
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_superuser( email='test2@test.com', ...
true
true
f71a82a3be56b6be5477fc4c0651779ed08eab77
3,249
py
Python
src/state.py
Amayas29/pyautomate
ea966348ea9d7ec153274bd7e2266bd50131cd3d
[ "MIT" ]
1
2021-03-24T21:12:56.000Z
2021-03-24T21:12:56.000Z
src/state.py
Amayas29/pyautomate
ea966348ea9d7ec153274bd7e2266bd50131cd3d
[ "MIT" ]
null
null
null
src/state.py
Amayas29/pyautomate
ea966348ea9d7ec153274bd7e2266bd50131cd3d
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- class State : """ Classe définissant un état caractérisée par : - un identifiant - un booleen pour savoir si c'est un état initial - un booleen pour savoir si c'est un état final - un label utilisé pour les constructions ou il faut memorise...
29.536364
75
0.515851
class State : def __init__ (self, id, init, fin, label=None) : self.id = id self.init = init self.fin = fin if label == None : self.label = str(self.id) else : self.label =label def __repr__(self) : ret = str(...
true
true
f71a82c5e1e63b262c2a25dc6c75f427f5c4eea8
8,829
py
Python
deep-clustering-conv-autoencoder/main.py
positivevaib/semi-supervised-imagenet-classification
4fb6427f5a72951c1b866a1ddbc2599811bb5770
[ "MIT" ]
null
null
null
deep-clustering-conv-autoencoder/main.py
positivevaib/semi-supervised-imagenet-classification
4fb6427f5a72951c1b866a1ddbc2599811bb5770
[ "MIT" ]
null
null
null
deep-clustering-conv-autoencoder/main.py
positivevaib/semi-supervised-imagenet-classification
4fb6427f5a72951c1b866a1ddbc2599811bb5770
[ "MIT" ]
null
null
null
# import import numpy as np import sklearn as skl import sklearn.cluster as cluster import sklearn.metrics as metrics import torch import torch.distributions.kl as kl import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as data import torchvision import torchvision.d...
29.727273
79
0.581493
import numpy as np import sklearn as skl import sklearn.cluster as cluster import sklearn.metrics as metrics import torch import torch.distributions.kl as kl import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as data import torchvision import torchvision.datasets ...
true
true
f71a8324690c575db20b997daa92e561d98a87c5
21,037
py
Python
wsgidav/samples/mysql_dav_provider.py
KnoooW/wsgidav
2cf357f72d2c835f376f2c1295897cb879ef6bc1
[ "MIT" ]
1
2021-12-29T08:27:04.000Z
2021-12-29T08:27:04.000Z
wsgidav/samples/mysql_dav_provider.py
KnoooW/wsgidav
2cf357f72d2c835f376f2c1295897cb879ef6bc1
[ "MIT" ]
null
null
null
wsgidav/samples/mysql_dav_provider.py
KnoooW/wsgidav
2cf357f72d2c835f376f2c1295897cb879ef6bc1
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # (c) 2009-2021 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Original PyFileServer (c) 2005 Ho Chun Wei. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Implementation of a WebDAV provider that provides a very basic, read-...
34.657331
95
0.553216
import csv import hashlib import time from io import StringIO import MySQLdb from wsgidav import util from wsgidav.dav_error import ( HTTP_FORBIDDEN, DAVError, PRECONDITION_CODE_ProtectedProperty, ) from wsgidav.dav_provider import DAVProvider, _DAVResource __docformat__ = "reStructuredText" _logg...
true
true
f71a833507215096556a8d151f20ec58347e380e
1,804
py
Python
meraki_sdk/models/switch_profile_port_model.py
meraki/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
37
2019-04-24T14:01:33.000Z
2022-01-28T01:37:21.000Z
meraki_sdk/models/switch_profile_port_model.py
ankita66666666/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
10
2019-07-09T16:35:11.000Z
2021-12-07T03:47:53.000Z
meraki_sdk/models/switch_profile_port_model.py
ankita66666666/meraki-python-sdk
9894089eb013318243ae48869cc5130eb37f80c0
[ "MIT" ]
17
2019-04-30T23:53:21.000Z
2022-02-07T22:57:44.000Z
# -*- coding: utf-8 -*- """ meraki_sdk This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class SwitchProfilePortModel(object): """Implementation of the 'SwitchProfilePort' model. TODO: type model description here. Attributes: ...
27.333333
95
0.583703
class SwitchProfilePortModel(object): _names = { "profile":'profile', "port_id":'portId' } def __init__(self, profile=None, port_id=None): self.profile = profile self.port_id = port_id @classmeth...
true
true
f71a8426ac96ef7e52fb2b1c74212768cb00e3c5
497
py
Python
sprites/blocker.py
ErezOr18/pygame-space-invaders
f2e129bb2e2e18470599573910e6cad34f501df8
[ "MIT" ]
null
null
null
sprites/blocker.py
ErezOr18/pygame-space-invaders
f2e129bb2e2e18470599573910e6cad34f501df8
[ "MIT" ]
null
null
null
sprites/blocker.py
ErezOr18/pygame-space-invaders
f2e129bb2e2e18470599573910e6cad34f501df8
[ "MIT" ]
null
null
null
from pygame import * class Blocker(sprite.Sprite): def __init__(self, size, color, row, column): sprite.Sprite.__init__(self) self.height = size self.width = size self.color = color self.image = Surface((self.width, self.height)) self.image.fill(self.color) ...
27.611111
55
0.607646
from pygame import * class Blocker(sprite.Sprite): def __init__(self, size, color, row, column): sprite.Sprite.__init__(self) self.height = size self.width = size self.color = color self.image = Surface((self.width, self.height)) self.image.fill(self.color) ...
true
true
f71a84f7b27fecc7c26682e691d6999bc0138353
245
py
Python
chaptertwo/famousquote2.py
cmotek/python_crashcourse
29cbdd6699cd17192bb599d235852d547630d110
[ "Apache-2.0" ]
null
null
null
chaptertwo/famousquote2.py
cmotek/python_crashcourse
29cbdd6699cd17192bb599d235852d547630d110
[ "Apache-2.0" ]
null
null
null
chaptertwo/famousquote2.py
cmotek/python_crashcourse
29cbdd6699cd17192bb599d235852d547630d110
[ "Apache-2.0" ]
null
null
null
famousauthor = "Herman Melville" print(famousauthor + ' wrote in Moby Dick, "Now then, thought I, unconsciously rolling up the sleeves of my frock, here goes a cool, collected dive at death and destruction, and the devil fetch the hindmost."')
61.25
210
0.767347
famousauthor = "Herman Melville" print(famousauthor + ' wrote in Moby Dick, "Now then, thought I, unconsciously rolling up the sleeves of my frock, here goes a cool, collected dive at death and destruction, and the devil fetch the hindmost."')
true
true
f71a8535015df8c0b0c3d55332640c315d8527a4
162,189
py
Python
jp.atcoder/abc081/arc086_b/17664033.py
kagemeka/atcoder-submissions
91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e
[ "MIT" ]
1
2022-02-09T03:06:25.000Z
2022-02-09T03:06:25.000Z
jp.atcoder/abc081/arc086_b/17664033.py
kagemeka/atcoder-submissions
91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e
[ "MIT" ]
1
2022-02-05T22:53:18.000Z
2022-02-09T01:29:30.000Z
jp.atcoder/abc081/arc086_b/17664033.py
kagemeka/atcoder-submissions
91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e
[ "MIT" ]
null
null
null
import itertools import math import string import sys from bisect import bisect_left as bi_l from bisect import bisect_right as bi_r from collections import Counter, defaultdict, deque from functools import lru_cache, reduce from heapq import heapify, heappop, heappush from operator import or_, xor sys.setr...
30.567094
1,217
0.35524
import itertools import math import string import sys from bisect import bisect_left as bi_l from bisect import bisect_right as bi_r from collections import Counter, defaultdict, deque from functools import lru_cache, reduce from heapq import heapify, heappop, heappush from operator import or_, xor sys.setr...
true
true
f71a85be328989ab5fd1d62bb8e59c2c2b19ba47
3,607
py
Python
src/ekpmeasure/experiments/ferroelectric/_switching/core.py
cjfinnell/ekpmeasure
e6611c053cad28e06f4f8a94764ebe3805cddb15
[ "MIT" ]
null
null
null
src/ekpmeasure/experiments/ferroelectric/_switching/core.py
cjfinnell/ekpmeasure
e6611c053cad28e06f4f8a94764ebe3805cddb15
[ "MIT" ]
null
null
null
src/ekpmeasure/experiments/ferroelectric/_switching/core.py
cjfinnell/ekpmeasure
e6611c053cad28e06f4f8a94764ebe3805cddb15
[ "MIT" ]
null
null
null
from ....control import core from ....control.instruments.berkeleynucleonics765 import stop from ..switching import preset_run_function import pandas as pd import numpy as np import os import warnings import time __all__ = ("FE",) class FE(core.experiment): """Experiment class for running pulsed Ferroelectric ...
36.806122
174
0.540061
from ....control import core from ....control.instruments.berkeleynucleonics765 import stop from ..switching import preset_run_function import pandas as pd import numpy as np import os import warnings import time __all__ = ("FE",) class FE(core.experiment): def __init__(self, pg, scope, scopetype="6604", run_...
true
true
f71a85f2c607d66f8e6260e04b8ed45d7f51a744
116
py
Python
plots/w.py
Tethik/whistleblower
56747cbf3c4eda95cee7eded36b4a853d33d6ee3
[ "MIT" ]
1
2016-06-20T12:35:42.000Z
2016-06-20T12:35:42.000Z
plots/w.py
Tethik/whistleblower
56747cbf3c4eda95cee7eded36b4a853d33d6ee3
[ "MIT" ]
null
null
null
plots/w.py
Tethik/whistleblower
56747cbf3c4eda95cee7eded36b4a853d33d6ee3
[ "MIT" ]
null
null
null
def w(j, p): return 4 * j * (1 - p) for p in [0.5, 0.75, 0.99]: print([w(j, p)*24*7 for j in [5, 20, 50]])
19.333333
46
0.448276
def w(j, p): return 4 * j * (1 - p) for p in [0.5, 0.75, 0.99]: print([w(j, p)*24*7 for j in [5, 20, 50]])
true
true
f71a8614737b2fe5ad5b8e12f3668178f8d6c600
8,334
py
Python
mindspore/ops/operations/__init__.py
ZephyrChenzf/mindspore
8f191847cf71e12715ced96bc3575914f980127a
[ "Apache-2.0" ]
null
null
null
mindspore/ops/operations/__init__.py
ZephyrChenzf/mindspore
8f191847cf71e12715ced96bc3575914f980127a
[ "Apache-2.0" ]
null
null
null
mindspore/ops/operations/__init__.py
ZephyrChenzf/mindspore
8f191847cf71e12715ced96bc3575914f980127a
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
27.78
117
0.583033
from .array_ops import (Argmax, Argmin, Cast, Concat, Pack, Unpack, Diag, DiagPart, DType, ExpandDims, Eye, Fill, GatherNd, GatherV2, InvertPermutation, IsInstance, IsSubClass, ArgMaxWithValue, OnesLike, ZerosLike, ...
true
true
f71a86b512e65c17c14cf1e55832bd7b556b892d
284,631
py
Python
tt.py
someone120/some-py
a14732b9fde52d5476e4a433e3eecea8ea3eeaec
[ "Apache-2.0" ]
null
null
null
tt.py
someone120/some-py
a14732b9fde52d5476e4a433e3eecea8ea3eeaec
[ "Apache-2.0" ]
null
null
null
tt.py
someone120/some-py
a14732b9fde52d5476e4a433e3eecea8ea3eeaec
[ "Apache-2.0" ]
null
null
null
import json a=""" [ { "_id": 1, "id": 1, "pid": 0, "city_code": "101010100", "city_name": "北京" }, { "_id": 2, "id": 2, "pid": 0, "city_code": "", "city_name": "安徽" }, { "_id": 3, "id": 3, "pid": 0, "city_code": "", "city_name": "福建" }, { "_id...
15.661439
30
0.434654
import json a=""" [ { "_id": 1, "id": 1, "pid": 0, "city_code": "101010100", "city_name": "北京" }, { "_id": 2, "id": 2, "pid": 0, "city_code": "", "city_name": "安徽" }, { "_id": 3, "id": 3, "pid": 0, "city_code": "", "city_name": "福建" }, { "_id...
true
true
f71a872cde99c049e202b8d9270f4ff266420483
3,749
gyp
Python
sync/sync.gyp
nagineni/chromium-crosswalk
5725642f1c67d0f97e8613ec1c3e8107ab53fdf8
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
231
2015-01-08T09:04:44.000Z
2021-12-30T03:03:10.000Z
sync/sync.gyp
j4ckfrost/android_external_chromium_org
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
1
2017-02-14T21:55:58.000Z
2017-02-14T21:55:58.000Z
sync/sync.gyp
j4ckfrost/android_external_chromium_org
a1a3dad8b08d1fcf6b6b36c267158ed63217c780
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
268
2015-01-21T05:53:28.000Z
2022-03-25T22:09:01.000Z
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'includes': [ 'sync_android.gypi', 'sync_tests.gypi', ], 'conditions': [ # Notes: # 1...
27.77037
80
0.497999
{ 'variables': { 'chromium_code': 1, }, 'includes': [ 'sync_android.gypi', 'sync_tests.gypi', ], 'conditions': [ ['component=="static_library"', { 'targets': [ { 'target_name': 'sync', 'type': 'none',...
true
true
f71a87d374e64809b39fcfe0bfb79d5e0281482c
641
py
Python
dkey/__init__.py
NOhs/dkey
5305e0028a858d7ec7cdf4889783650b026ad4f5
[ "MIT" ]
2
2019-01-18T19:53:07.000Z
2019-02-01T12:30:45.000Z
dkey/__init__.py
NOhs/dkey
5305e0028a858d7ec7cdf4889783650b026ad4f5
[ "MIT" ]
15
2019-01-14T18:11:20.000Z
2019-03-30T14:22:35.000Z
dkey/__init__.py
NOhs/dkey
5305e0028a858d7ec7cdf4889783650b026ad4f5
[ "MIT" ]
1
2019-02-01T21:51:15.000Z
2019-02-01T21:51:15.000Z
"""Module containing tools to deprecate the use of selected keys in a given dictionary. This module provides: deprecate_keys ============== Class to wrap a dict to deprecate some keys in it. dkey ==== Function to generate deprecated keys. __version__ =========== A string indicating which version of dkey is currentl...
21.366667
87
0.74415
from ._dkey import deprecate_keys as deprecate_keys from ._dkey import dkey as dkey from pbr.version import VersionInfo _v = VersionInfo('mgen').semantic_version() __version__ = _v.release_string() version_info = _v.version_tuple()
true
true
f71a87fef420481a4397ce77f7a2bd37c708dd91
6,159
py
Python
pydec/math/kd_tree.py
hirani/pydec
0574d1148952510b0e59b1f5cb1d9a673193be7f
[ "BSD-3-Clause" ]
49
2016-07-03T14:40:48.000Z
2022-03-08T01:33:03.000Z
pydec/math/kd_tree.py
hirani/pydec
0574d1148952510b0e59b1f5cb1d9a673193be7f
[ "BSD-3-Clause" ]
4
2016-09-16T18:51:06.000Z
2020-06-20T03:53:24.000Z
pydec/math/kd_tree.py
hirani/pydec
0574d1148952510b0e59b1f5cb1d9a673193be7f
[ "BSD-3-Clause" ]
15
2015-09-26T20:06:57.000Z
2021-06-21T17:01:02.000Z
__all__ = ['kd_tree'] from math import sqrt from heapq import heappush,heappop class kd_tree: class node: def point_distance(self,point): return sqrt(sum([ (a - b)**2 for (a,b) in zip(point,self.point)])) def separator_distance(self,point): return point[self.axis] - self.p...
30.339901
102
0.539211
__all__ = ['kd_tree'] from math import sqrt from heapq import heappush,heappop class kd_tree: class node: def point_distance(self,point): return sqrt(sum([ (a - b)**2 for (a,b) in zip(point,self.point)])) def separator_distance(self,point): return point[self.axis] - self.p...
true
true
f71a88666c1fd19fd83b8b1279071950abcd31d2
3,505
py
Python
model/config.py
yhl111/PCNN
2e0967aec962d55df1eb7d149a44b91c6c751a1a
[ "Apache-2.0" ]
99
2018-05-19T03:59:47.000Z
2022-03-17T07:25:10.000Z
model/config.py
yhl111/PCNN
2e0967aec962d55df1eb7d149a44b91c6c751a1a
[ "Apache-2.0" ]
10
2018-05-21T13:16:42.000Z
2022-03-26T06:06:51.000Z
model/config.py
yhl111/PCNN
2e0967aec962d55df1eb7d149a44b91c6c751a1a
[ "Apache-2.0" ]
38
2018-05-19T10:20:57.000Z
2022-01-25T12:37:08.000Z
import os import numpy as np from .general_utils import get_logger from .data_utils import load_vocab, get_processing_word class Config(): def __init__(self, load=True): """Initialize hyperparameters and load vocabs Args: load_embeddings: (bool) if True, load embeddings into ...
31.294643
87
0.653067
import os import numpy as np from .general_utils import get_logger from .data_utils import load_vocab, get_processing_word class Config(): def __init__(self, load=True): if not os.path.exists(self.dir_output): os.makedirs(self.dir_output) self.logger = get_logger(sel...
true
true
f71a89aa8b0e3fea02389bae72a1e0206e098bc4
4,846
py
Python
tests/algorithms/test_tracking_smoothing.py
thompson318/scikit-surgerycore
22867073a5a3e87def68b4a76e70fe54d085be32
[ "BSD-3-Clause" ]
3
2020-09-26T18:19:49.000Z
2021-09-19T08:43:00.000Z
tests/algorithms/test_tracking_smoothing.py
thompson318/scikit-surgerycore
22867073a5a3e87def68b4a76e70fe54d085be32
[ "BSD-3-Clause" ]
45
2020-04-27T09:12:28.000Z
2020-04-27T09:50:49.000Z
tests/algorithms/test_tracking_smoothing.py
SciKit-Surgery/scikit-surgerycore
22867073a5a3e87def68b4a76e70fe54d085be32
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """Tests for BARD pointer module""" import math import numpy as np import pytest import sksurgerycore.algorithms.tracking_smoothing as reg def test_rvec_to_quaterion(): """ Does it convert correctly """ #a 90 degree rotation about the x axis rvec = np.array([math.pi/2.0, ...
27.691429
107
0.636401
import math import numpy as np import pytest import sksurgerycore.algorithms.tracking_smoothing as reg def test_rvec_to_quaterion(): rvec = np.array([math.pi/2.0, 0.0, 0.0]) quaternion = reg._rvec_to_quaternion(rvec) assert quaternion[0] == math.cos(math.pi/4.0) assert quaternion[1] == 1.0 *...
true
true
f71a8a1a3d48005a0ee4af6cf7d83fd52dcee595
1,223
py
Python
web/playlists/migrations/0001__initial.py
vtalks/vtalks.net
80fb19ff9684e0854c6abe5f0eef73e80ec326a6
[ "Apache-2.0" ]
1
2017-11-28T03:17:23.000Z
2017-11-28T03:17:23.000Z
web/playlists/migrations/0001__initial.py
vtalks/vtalks.net
80fb19ff9684e0854c6abe5f0eef73e80ec326a6
[ "Apache-2.0" ]
56
2018-01-14T18:03:03.000Z
2018-06-25T17:59:02.000Z
web/playlists/migrations/0001__initial.py
vtalks/vtalks.net
80fb19ff9684e0854c6abe5f0eef73e80ec326a6
[ "Apache-2.0" ]
null
null
null
# Generated by Django 2.0.2 on 2018-02-23 08:56 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Playlists', fields=[ ...
35.970588
114
0.578087
from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Playlists', fields=[ ('id', models.AutoField(auto_created=Tru...
true
true
f71a8adea750a9a9bae32bcd140b26a2c336c2a6
3,692
py
Python
trees-and-graphs/minimal-tree.py
georgeRenard/CrackingTheCodingInterview
ba9866e8e7a8c9942464d76b13af08ea6b15f3f9
[ "MIT" ]
null
null
null
trees-and-graphs/minimal-tree.py
georgeRenard/CrackingTheCodingInterview
ba9866e8e7a8c9942464d76b13af08ea6b15f3f9
[ "MIT" ]
null
null
null
trees-and-graphs/minimal-tree.py
georgeRenard/CrackingTheCodingInterview
ba9866e8e7a8c9942464d76b13af08ea6b15f3f9
[ "MIT" ]
null
null
null
import sys def problem(): """ Minimal Tree: Given a sorted (increasing order) array with unique integer elements, write an algorithm to create a binary search tree with minimal height. """ pass class BST: def __init__(self): self.count = 0 self.root = None ...
22.512195
170
0.581798
import sys def problem(): pass class BST: def __init__(self): self.count = 0 self.root = None @staticmethod def build_from_sorted_array(arr): root = BST.__build_from_sorted_array(arr) bst = BST() bst.root = root return bst @static...
true
true
f71a8bd251c72ed72e4f3105b3a56a3e0dee9bf4
14,903
py
Python
xero_python/accounting/models/repeating_invoice.py
sidtrengove/xero-python
52f1ec2232def4c8e773e8e5fd6f766c059517b2
[ "MIT" ]
1
2020-06-05T15:03:15.000Z
2020-06-05T15:03:15.000Z
xero_python/accounting/models/repeating_invoice.py
sidtrengove/xero-python
52f1ec2232def4c8e773e8e5fd6f766c059517b2
[ "MIT" ]
null
null
null
xero_python/accounting/models/repeating_invoice.py
sidtrengove/xero-python
52f1ec2232def4c8e773e8e5fd6f766c059517b2
[ "MIT" ]
null
null
null
# coding: utf-8 """ Accounting API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: 2.1.6 Contact: api@xero.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 from xero_pytho...
28.881783
124
0.609072
import re from xero_python.models import BaseModel class RepeatingInvoice(BaseModel): openapi_types = { "type": "str", "contact": "Contact", "schedule": "Schedule", "line_items": "list[LineItem]", "line_amount_types": "LineAmountTypes", "reference": "str", ...
true
true
f71a8c220df84bc1e3780600d32aac91ad2146a3
2,355
py
Python
scripts/dca.py
Fu-Om/bitbank-dca
17b24bc09bc1980b90f63113909bb8d62c8ff885
[ "MIT" ]
null
null
null
scripts/dca.py
Fu-Om/bitbank-dca
17b24bc09bc1980b90f63113909bb8d62c8ff885
[ "MIT" ]
null
null
null
scripts/dca.py
Fu-Om/bitbank-dca
17b24bc09bc1980b90f63113909bb8d62c8ff885
[ "MIT" ]
null
null
null
#!/usr/bin/env python import python_bitbankcc from math import floor from datetime import datetime import pathlib import csv from settings import BITBANK_API_KEY, BITBANK_API_SECRET class BitBankPubAPI: def __init__(self): self.pub = python_bitbankcc.public() def get_ticker(self, pair): try:...
28.719512
86
0.61104
import python_bitbankcc from math import floor from datetime import datetime import pathlib import csv from settings import BITBANK_API_KEY, BITBANK_API_SECRET class BitBankPubAPI: def __init__(self): self.pub = python_bitbankcc.public() def get_ticker(self, pair): try: value = ...
true
true
f71a8d0e28e916e21d6205427d7bc48512999cec
15,536
py
Python
tensorflow_probability/python/distributions/deterministic.py
bourov/probability
1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2
[ "Apache-2.0" ]
2
2020-12-17T20:43:24.000Z
2021-06-11T22:09:16.000Z
tensorflow_probability/python/distributions/deterministic.py
bourov/probability
1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2
[ "Apache-2.0" ]
2
2021-08-25T16:14:51.000Z
2022-02-10T04:47:11.000Z
tensorflow_probability/python/distributions/deterministic.py
bourov/probability
1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2
[ "Apache-2.0" ]
1
2020-12-19T13:05:15.000Z
2020-12-19T13:05:15.000Z
# 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...
34.524444
80
0.655381
from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six import tensorflow.compat.v2 as tf from tensorflow_probability.python.distributions import distribution from tensorflow_probability.python.distributions import kullback_le...
true
true
f71a8d25f1b81ca9d952d8f9624d010c487bd0bf
185
py
Python
tests/test_app/apps.py
JiriKr/django-migrate-sql
b848acb14679ce8bf472d91e52c85afcce2c5db2
[ "ISC" ]
13
2016-01-05T12:21:11.000Z
2021-08-30T05:41:39.000Z
tests/test_app/apps.py
JiriKr/django-migrate-sql
b848acb14679ce8bf472d91e52c85afcce2c5db2
[ "ISC" ]
10
2015-12-27T14:40:31.000Z
2020-04-01T11:40:36.000Z
tests/test_app/apps.py
JiriKr/django-migrate-sql
b848acb14679ce8bf472d91e52c85afcce2c5db2
[ "ISC" ]
3
2017-10-29T11:26:27.000Z
2019-01-03T17:16:54.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class TestAppConfig(AppConfig): name = 'test_app' verbose_name = 'Test App'
18.5
39
0.718919
from __future__ import unicode_literals from django.apps import AppConfig class TestAppConfig(AppConfig): name = 'test_app' verbose_name = 'Test App'
true
true