hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7364938bee84bc37cb934a1a72e167de4cec658 | 1,953 | py | Python | examples/tlstest/server.py | irmen/Pyro3 | 5bd531088d9a11ec83556a0429f18df6cb5cd437 | [
"MIT"
] | 3 | 2018-01-13T20:50:41.000Z | 2020-02-24T13:35:08.000Z | examples/tlstest/server.py | irmen/Pyro3 | 5bd531088d9a11ec83556a0429f18df6cb5cd437 | [
"MIT"
] | null | null | null | examples/tlstest/server.py | irmen/Pyro3 | 5bd531088d9a11ec83556a0429f18df6cb5cd437 | [
"MIT"
] | 6 | 2015-03-21T20:34:05.000Z | 2021-06-08T04:04:33.000Z | import threading
import sys
import Pyro.core
try:
import win32com.client, pythoncom
has_com=True
except ImportError:
has_com=False
class TestServer(Pyro.core.ObjBase):
def ping(self):
threadid=threading.currentThread().ident
tls=self.getLocalStorage()
output="se... | 33.672414 | 108 | 0.603175 | import threading
import sys
import Pyro.core
try:
import win32com.client, pythoncom
has_com=True
except ImportError:
has_com=False
class TestServer(Pyro.core.ObjBase):
def ping(self):
threadid=threading.currentThread().ident
tls=self.getLocalStorage()
output="se... | false | true |
f736498c71b92611343f1c80a567282dd6f753c1 | 413 | py | Python | eHealth_Version1.0_01_13_2022_12_47_pm_Release/BUS/BUS_XRayPatient.py | kyvipro113/Graduation_Thesis | 71e9e3aa2adf64cff7319d056592f8b6ef1fd5ec | [
"MIT"
] | null | null | null | eHealth_Version1.0_01_13_2022_12_47_pm_Release/BUS/BUS_XRayPatient.py | kyvipro113/Graduation_Thesis | 71e9e3aa2adf64cff7319d056592f8b6ef1fd5ec | [
"MIT"
] | null | null | null | eHealth_Version1.0_01_13_2022_12_47_pm_Release/BUS/BUS_XRayPatient.py | kyvipro113/Graduation_Thesis | 71e9e3aa2adf64cff7319d056592f8b6ef1fd5ec | [
"MIT"
] | null | null | null | from DAL.DAL_XRayPatient import DAL_XRayPatient
class BUS_XRayPatient():
def __init__(self):
self.dalXRayPatient = DAL_XRayPatient()
def firstLoadLinkXRay(self, IDPatient):
return self.dalXRayPatient.selectLinkXRayViaIDPatient(IDPatient=IDPatient)
def loadLinkXRay(self, IDPatient, XRayTyp... | 37.545455 | 89 | 0.774818 | from DAL.DAL_XRayPatient import DAL_XRayPatient
class BUS_XRayPatient():
def __init__(self):
self.dalXRayPatient = DAL_XRayPatient()
def firstLoadLinkXRay(self, IDPatient):
return self.dalXRayPatient.selectLinkXRayViaIDPatient(IDPatient=IDPatient)
def loadLinkXRay(self, IDPatient, XRayTyp... | true | true |
f7364b16fc4142c59fd6ce8321417e4f024bf8de | 1,543 | py | Python | internal/notes/builtin-SAVE/packages/r-rodbc/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/r-rodbc/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/r-rodbc/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 41.702703 | 78 | 0.672715 | true | true | |
f7364bb8d7801da82a198367f1f1d7ca19fe8f6b | 373 | py | Python | wordcloud/__init__.py | jcfr/word_cloud | d01847f973b45af9198c36b922a908b4374afe4d | [
"MIT"
] | null | null | null | wordcloud/__init__.py | jcfr/word_cloud | d01847f973b45af9198c36b922a908b4374afe4d | [
"MIT"
] | null | null | null | wordcloud/__init__.py | jcfr/word_cloud | d01847f973b45af9198c36b922a908b4374afe4d | [
"MIT"
] | null | null | null | from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
get_single_color_func)
from .color_from_image import ImageColorGenerator
__all__ = ['WordCloud', 'STOPWORDS', 'random_color_func',
'get_single_color_func', 'ImageColorGenerator']
from ._version import get_versions
__ve... | 33.909091 | 64 | 0.742627 | from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
get_single_color_func)
from .color_from_image import ImageColorGenerator
__all__ = ['WordCloud', 'STOPWORDS', 'random_color_func',
'get_single_color_func', 'ImageColorGenerator']
from ._version import get_versions
__ve... | true | true |
f7364c56f83403121dd05f261447211892d91a9e | 542 | py | Python | I_love_Easin.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | I_love_Easin.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | I_love_Easin.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 28 12:20:40 2021
@author: Easin
"""
in1 = input()
in1 = int(in1)
in2 = input().split()
list1 = []
for elem in range(len(in2)):
list1.append(int(in2[elem]))
#print(list1)
amazing = 0
min1 = list1[0]
max1 = list1[0]
for val in range(len(lis... | 16.424242 | 36 | 0.498155 |
in1 = input()
in1 = int(in1)
in2 = input().split()
list1 = []
for elem in range(len(in2)):
list1.append(int(in2[elem]))
amazing = 0
min1 = list1[0]
max1 = list1[0]
for val in range(len(list1)-1):
if list1[val +1] > min1:
amazing +=1
min1 = list1[val+1]
... | true | true |
f7364d5dfda7356574ef3f753491f24da0998c62 | 854 | py | Python | triple_agent/reports/generation/generate_external_reports.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | 3 | 2020-04-25T11:42:03.000Z | 2020-07-08T16:38:26.000Z | triple_agent/reports/generation/generate_external_reports.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | 17 | 2019-08-11T19:09:55.000Z | 2021-03-30T17:12:28.000Z | triple_agent/reports/generation/generate_external_reports.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | null | null | null | import json
from enum import Enum
from triple_agent.reports.generation.generic_query import populate_data_properties
def generate_external_reports(
games, data_query_properties, json_file_path, html_file_path
):
_, data_props = populate_data_properties(games, data_query_properties)
# https://github.com/... | 35.583333 | 82 | 0.75644 | import json
from enum import Enum
from triple_agent.reports.generation.generic_query import populate_data_properties
def generate_external_reports(
games, data_query_properties, json_file_path, html_file_path
):
_, data_props = populate_data_properties(games, data_query_properties)
if isinstan... | true | true |
f7364d9908dc590a28f74d0749e5123f5854f229 | 160,627 | py | Python | IsoFit.py | wjwainwright/Capstone | a2ea661079ece6ff5008f4399b3f0f6d32c598d3 | [
"MIT"
] | null | null | null | IsoFit.py | wjwainwright/Capstone | a2ea661079ece6ff5008f4399b3f0f6d32c598d3 | [
"MIT"
] | null | null | null | IsoFit.py | wjwainwright/Capstone | a2ea661079ece6ff5008f4399b3f0f6d32c598d3 | [
"MIT"
] | null | null | null | try:
runCount += 1
except:
isoIn = False
clIn = False
cataIn = False
closePlots = False
resultsIn = False
clusterList = []
clusters=[]
isochrones = []
isoList = []
catalogue = []
runCount = 1
class resultClusterObj:
def __init__(self,cl):
import numpy as np
... | 37.599953 | 457 | 0.588674 | try:
runCount += 1
except:
isoIn = False
clIn = False
cataIn = False
closePlots = False
resultsIn = False
clusterList = []
clusters=[]
isochrones = []
isoList = []
catalogue = []
runCount = 1
class resultClusterObj:
def __init__(self,cl):
import numpy as np
... | true | true |
f7364db0a9b0f7a13ada988a208e0f0859847424 | 2,476 | py | Python | neurolib/utils/saver.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 258 | 2020-01-26T14:38:09.000Z | 2022-03-31T14:54:04.000Z | neurolib/utils/saver.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 172 | 2020-01-27T11:02:28.000Z | 2022-03-22T22:25:38.000Z | neurolib/utils/saver.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 49 | 2020-02-04T08:34:44.000Z | 2022-03-28T09:29:12.000Z | """
Saving model output.
"""
import json
import pickle
from copy import deepcopy
import os
import numpy as np
import xarray as xr
def save_to_pickle(datafield, filename):
"""
Save datafield to pickle file. Keep in mind that restoring a pickle
requires that the internal structure of the types for the pi... | 29.47619 | 117 | 0.640549 |
import json
import pickle
from copy import deepcopy
import os
import numpy as np
import xarray as xr
def save_to_pickle(datafield, filename):
assert isinstance(datafield, (xr.DataArray, xr.Dataset))
if not filename.endswith(".pkl"):
filename += ".pkl"
with open(filename, "wb") as handle:
... | true | true |
f7364ddf2333b397212e2ec8913c3f5019780df6 | 163 | py | Python | vizdoomgym/envs/vizdoomtakecover.py | AlexGonRo/vizdoomgym | 231b5f07d878f4e8cab49e09db5cbc38c2d3abfb | [
"MIT"
] | 1 | 2021-04-13T19:05:27.000Z | 2021-04-13T19:05:27.000Z | vizdoomgym/envs/vizdoomtakecover.py | safijari/vizdoomgym | 4ba08296d528a40ce865f30f7abfef93417614f4 | [
"MIT"
] | 12 | 2019-10-21T04:53:12.000Z | 2022-02-10T00:28:37.000Z | vizdoomgym/envs/vizdoomtakecover.py | safijari/vizdoomgym | 4ba08296d528a40ce865f30f7abfef93417614f4 | [
"MIT"
] | 1 | 2021-12-14T12:20:39.000Z | 2021-12-14T12:20:39.000Z | from vizdoomgym.envs.vizdoomenv import VizdoomEnv
class VizdoomTakeCover(VizdoomEnv):
def __init__(self):
super(VizdoomTakeCover, self).__init__(7)
| 20.375 | 49 | 0.760736 | from vizdoomgym.envs.vizdoomenv import VizdoomEnv
class VizdoomTakeCover(VizdoomEnv):
def __init__(self):
super(VizdoomTakeCover, self).__init__(7)
| true | true |
f7364f6d6829dd6dc289c75df401165fac819425 | 2,399 | py | Python | tests/test_tensor_transform.py | aripekka/tbcalc | a0337db245f5391bfa9a42123994832c299b1fbe | [
"MIT"
] | 1 | 2020-05-03T00:10:39.000Z | 2020-05-03T00:10:39.000Z | tests/test_tensor_transform.py | aripekka/tbcalc | a0337db245f5391bfa9a42123994832c299b1fbe | [
"MIT"
] | null | null | null | tests/test_tensor_transform.py | aripekka/tbcalc | a0337db245f5391bfa9a42123994832c299b1fbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tests for the tensor transform functions. Run with pytest.
Created on Sat May 9 00:09:00 2020
@author: aripekka
"""
import sys
import os.path
import numpy as np
sys.path.insert(1, os.path.join(os.path.dirname(__file__),'..'))
from tbcalc.transverse_deformation import *
from tbcalc impo... | 31.155844 | 108 | 0.60025 |
import sys
import os.path
import numpy as np
sys.path.insert(1, os.path.join(os.path.dirname(__file__),'..'))
from tbcalc.transverse_deformation import *
from tbcalc import cartesian_tensors_to_cylindrical
from pyTTE import TTcrystal, Quantity
def test_isotropic_circular():
E = 165
nu = 0.22
... | true | true |
f736512234f6783eb63953d115f2c91aeee1b5bf | 23,644 | py | Python | src/trapi/trapi.py | guilhermehott/trapi | 7f44df1872b2e253bc423fa92a52efdd6d4fdbf1 | [
"MIT"
] | 1 | 2022-03-23T23:16:04.000Z | 2022-03-23T23:16:04.000Z | src/trapi/trapi.py | guilhermehott/trapi | 7f44df1872b2e253bc423fa92a52efdd6d4fdbf1 | [
"MIT"
] | null | null | null | src/trapi/trapi.py | guilhermehott/trapi | 7f44df1872b2e253bc423fa92a52efdd6d4fdbf1 | [
"MIT"
] | null | null | null | import asyncio
import base64
import hashlib
import json
import logging
import time
import urllib.parse
import uuid
import requests
import websockets
from ecdsa import NIST256p, SigningKey
from ecdsa.util import sigencode_der
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(messag... | 39.737815 | 126 | 0.611487 | import asyncio
import base64
import hashlib
import json
import logging
import time
import urllib.parse
import uuid
import requests
import websockets
from ecdsa import NIST256p, SigningKey
from ecdsa.util import sigencode_der
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(messag... | true | true |
f73653a564946bc4476618628286841d18811544 | 87 | py | Python | URI/1 - INICIANTE/Python/1002 - AeraCirculo.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | 1 | 2020-04-14T16:48:16.000Z | 2020-04-14T16:48:16.000Z | URI/1 - INICIANTE/Python/1002 - AeraCirculo.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | URI/1 - INICIANTE/Python/1002 - AeraCirculo.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | raio = float(input())
n = 3.14159
area = n * pow(raio,2)
print('A={:.4f}'.format(area)) | 21.75 | 30 | 0.597701 | raio = float(input())
n = 3.14159
area = n * pow(raio,2)
print('A={:.4f}'.format(area)) | true | true |
f73653de4094f8605b644d6f1bb802bce0914670 | 2,100 | py | Python | convert_ymls.py | geofabrik/openstreetmap-carto-vectortiles | 80f8d70b17c2db4b24bfed94f128f3ef03e0ef16 | [
"CC0-1.0"
] | 50 | 2016-07-13T17:02:22.000Z | 2021-12-21T14:00:27.000Z | convert_ymls.py | geofabrik/openstreetmap-carto-vectortiles | 80f8d70b17c2db4b24bfed94f128f3ef03e0ef16 | [
"CC0-1.0"
] | 5 | 2016-12-22T14:40:57.000Z | 2018-11-10T19:44:23.000Z | convert_ymls.py | geofabrik/openstreetmap-carto-vectortiles | 80f8d70b17c2db4b24bfed94f128f3ef03e0ef16 | [
"CC0-1.0"
] | 6 | 2016-07-29T19:12:44.000Z | 2022-03-31T14:41:33.000Z | import argparse, yaml, os, os.path
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input")
parser.add_argument("-o", "--output")
parser.add_argument("--tm2", "--tm", action="store_const", const="tm2", dest="action")
parser.add_argument("--tm2source", "--tmsource", action="store_const", const="tm2source... | 36.206897 | 108 | 0.661905 | import argparse, yaml, os, os.path
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input")
parser.add_argument("-o", "--output")
parser.add_argument("--tm2", "--tm", action="store_const", const="tm2", dest="action")
parser.add_argument("--tm2source", "--tmsource", action="store_const", const="tm2source... | true | true |
f736544ee090ae0f772d827cff827a4f55b45858 | 3,479 | py | Python | QUANTAXIS/QASetting/crontab.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 2 | 2019-05-31T02:53:12.000Z | 2020-03-09T03:21:55.000Z | QUANTAXIS/QASetting/crontab.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | null | null | null | QUANTAXIS/QASetting/crontab.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 3 | 2018-11-29T07:07:56.000Z | 2021-02-09T17:24:56.000Z | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... | 37.010638 | 80 | 0.634378 |
import md5
import time
from .external.crontab import CronTab as _CronTab
from QUANTAXIS.QASetting.cache import get_cache
| true | true |
f73654a1fc198e5bf51531dd3397e8f7e7919a6b | 957 | py | Python | stackl/helpers.py | ArtOfCode-/stackl | c66c025fa39c5fc5a6dbda7f0ea0628ee526b4b6 | [
"MIT"
] | null | null | null | stackl/helpers.py | ArtOfCode-/stackl | c66c025fa39c5fc5a6dbda7f0ea0628ee526b4b6 | [
"MIT"
] | null | null | null | stackl/helpers.py | ArtOfCode-/stackl | c66c025fa39c5fc5a6dbda7f0ea0628ee526b4b6 | [
"MIT"
] | null | null | null | class Helpers:
_cache = {}
@classmethod
def cached(cls, key, scope=None, func=None):
if scope is not None:
if scope not in cls._cache:
cls._cache[scope] = {}
if key in cls._cache[scope]:
return cls._cache[scope][key]
else:
... | 28.147059 | 57 | 0.487983 | class Helpers:
_cache = {}
@classmethod
def cached(cls, key, scope=None, func=None):
if scope is not None:
if scope not in cls._cache:
cls._cache[scope] = {}
if key in cls._cache[scope]:
return cls._cache[scope][key]
else:
... | true | true |
f736559162d2fb353e82402c79261dc665f58d3e | 425 | py | Python | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-09T09:51:13.000Z | 2021-06-09T09:51:13.000Z | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | null | null | null | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-15T11:31:44.000Z | 2021-06-15T11:31:44.000Z | """
PyTorch Forecasting package for timeseries forecasting with PyTorch.
"""
from pytorch_forecasting.data import EncoderNormalizer, GroupNormalizer, TimeSeriesDataSet
from pytorch_forecasting.models import Baseline, NBeats, TemporalFusionTransformer
__all__ = [
"TimeSeriesDataSet",
"GroupNormalizer",
"Enc... | 25 | 90 | 0.764706 | from pytorch_forecasting.data import EncoderNormalizer, GroupNormalizer, TimeSeriesDataSet
from pytorch_forecasting.models import Baseline, NBeats, TemporalFusionTransformer
__all__ = [
"TimeSeriesDataSet",
"GroupNormalizer",
"EncoderNormalizer",
"TemporalFusionTransformer",
"NBeats",
"Baseline... | true | true |
f73655e939118e53abadbf7e66e1712cae7bc2c9 | 6,540 | py | Python | tensorflow_toolkit/text_recognition/text_recognition/model.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 3 | 2020-12-29T02:47:32.000Z | 2021-11-12T08:12:51.000Z | tensorflow_toolkit/text_recognition/text_recognition/model.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 28 | 2020-09-25T22:40:36.000Z | 2022-03-12T00:37:36.000Z | tensorflow_toolkit/text_recognition/text_recognition/model.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 1 | 2021-03-12T10:08:44.000Z | 2021-03-12T10:08:44.000Z | # Copyright (C) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 49.172932 | 97 | 0.595107 |
import tensorflow as tf
from tensorflow.contrib import rnn
import tensorflow.contrib.slim as slim
class TextRecognition:
def __init__(self, is_training, num_classes, backbone_dropout=0.0):
self.is_training = is_training
self.lstm_dim = 256
self.num_classes = num_classes
... | true | true |
f7365607c63fb7621a70cad35ff167547d52229e | 24,303 | py | Python | Warlords/PublicMaps/Fantasy_Realm.py | f1rpo/Civ4CE | ba64c3545b479887739ad0ff78605b51b6fa57f9 | [
"CNRI-Python"
] | null | null | null | Warlords/PublicMaps/Fantasy_Realm.py | f1rpo/Civ4CE | ba64c3545b479887739ad0ff78605b51b6fa57f9 | [
"CNRI-Python"
] | null | null | null | Warlords/PublicMaps/Fantasy_Realm.py | f1rpo/Civ4CE | ba64c3545b479887739ad0ff78605b51b6fa57f9 | [
"CNRI-Python"
] | null | null | null | #
# FILE: Fantasy_Realm.py
# AUTHOR: Bob Thomas (Sirian)
# PURPOSE: Regional map script - Fantastical terrain, X and Y Wrap
#-----------------------------------------------------------------------------
# Copyright (c) 2005 Firaxis Games, Inc. All rights reserved.
#----------------------------------------------... | 40.170248 | 202 | 0.729252 |
from CvPythonExtensions import *
import CvUtil
import CvMapGeneratorUtil
import random
import sys
from CvMapGeneratorUtil import FractalWorld
from CvMapGeneratorUtil import TerrainGenerator
from CvMapGeneratorUtil import FeatureGenerator
def getDescription():
return "TXT_KEY_MAP_SCRIPT_FANTASY_REA... | false | true |
f7365729a08e2f23924988f567fa30354632418c | 4,823 | py | Python | docs/conf.py | michaelbilow/issho | ed0dd5487978b1753c14ce5d444d07448b13d168 | [
"MIT"
] | 1 | 2019-04-22T17:20:05.000Z | 2019-04-22T17:20:05.000Z | docs/conf.py | michaelbilow/smol | ed0dd5487978b1753c14ce5d444d07448b13d168 | [
"MIT"
] | 7 | 2019-03-28T14:26:46.000Z | 2019-05-31T03:58:26.000Z | docs/conf.py | michaelbilow/smol | ed0dd5487978b1753c14ce5d444d07448b13d168 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# issho documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 30.916667 | 81 | 0.681733 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
import issho
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = u"issho"
copyright = u"2019, Michael Bilow"
author = u"Mi... | true | true |
f7365971d36a0732ad199a569df15896294a5c5d | 2,173 | py | Python | app.py | liyunze-coding/Trigger-Me-Elmo-2 | 6950ffa4bfd264e213626f1ab3cff249fbab36da | [
"MIT"
] | 1 | 2022-01-02T09:50:38.000Z | 2022-01-02T09:50:38.000Z | app.py | liyunze-coding/Trigger-Me-Elmo-2 | 6950ffa4bfd264e213626f1ab3cff249fbab36da | [
"MIT"
] | null | null | null | app.py | liyunze-coding/Trigger-Me-Elmo-2 | 6950ffa4bfd264e213626f1ab3cff249fbab36da | [
"MIT"
] | 1 | 2022-01-10T19:59:15.000Z | 2022-01-10T19:59:15.000Z | from flask import Flask, render_template, request, jsonify
import base64
import logging
import numpy as np
from deepface import DeepFace
from PIL import Image
from io import BytesIO
import subprocess
import os
import cv2
import random
import webbrowser
app = Flask(__name__)
log = logging.getLogger('werkzeug')
log.setL... | 25.869048 | 88 | 0.658076 | from flask import Flask, render_template, request, jsonify
import base64
import logging
import numpy as np
from deepface import DeepFace
from PIL import Image
from io import BytesIO
import subprocess
import os
import cv2
import random
import webbrowser
app = Flask(__name__)
log = logging.getLogger('werkzeug')
log.setL... | true | true |
f7365980ef0f648a9b1148fdf6a7cf556501bab6 | 15,803 | py | Python | solver.py | pyrito/SpeechSplit | ee70ee77e54d5b7cd1b39e7bef1cb96ae78f8beb | [
"MIT"
] | null | null | null | solver.py | pyrito/SpeechSplit | ee70ee77e54d5b7cd1b39e7bef1cb96ae78f8beb | [
"MIT"
] | null | null | null | solver.py | pyrito/SpeechSplit | ee70ee77e54d5b7cd1b39e7bef1cb96ae78f8beb | [
"MIT"
] | null | null | null | from torch.utils.tensorboard.summary import hparams
from model import Generator_3 as Generator
from model import InterpLnr
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
import numpy as np
import os
import time
import datetime
import pickle
from utils import pad_seq_to_2, quantize_f0_torc... | 45.41092 | 137 | 0.485351 | from torch.utils.tensorboard.summary import hparams
from model import Generator_3 as Generator
from model import InterpLnr
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
import numpy as np
import os
import time
import datetime
import pickle
from utils import pad_seq_to_2, quantize_f0_torc... | true | true |
f7365a1da28790199225cb69fa9ccb4430d35ff0 | 1,133 | py | Python | cms/test_utils/project/placeholderapp/admin.py | foobacca/django-cms | d15586b399b18de49208bca74495a771cdbd494f | [
"BSD-3-Clause"
] | 1 | 2021-04-08T13:49:04.000Z | 2021-04-08T13:49:04.000Z | cms/test_utils/project/placeholderapp/admin.py | foobacca/django-cms | d15586b399b18de49208bca74495a771cdbd494f | [
"BSD-3-Clause"
] | 8 | 2021-06-08T23:36:57.000Z | 2022-03-12T00:49:20.000Z | cms/test_utils/project/placeholderapp/admin.py | foobacca/django-cms | d15586b399b18de49208bca74495a771cdbd494f | [
"BSD-3-Clause"
] | null | null | null | from cms.admin.placeholderadmin import PlaceholderAdmin
from cms.test_utils.project.placeholderapp.models import (Example1, MultilingualExample1, TwoPlaceholderExample)
from django.contrib import admin
from hvad.admin import TranslatableAdmin
class MixinAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_... | 32.371429 | 112 | 0.772286 | from cms.admin.placeholderadmin import PlaceholderAdmin
from cms.test_utils.project.placeholderapp.models import (Example1, MultilingualExample1, TwoPlaceholderExample)
from django.contrib import admin
from hvad.admin import TranslatableAdmin
class MixinAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_... | true | true |
f7365a4261bf5528b341b9ad8439969db155368a | 591 | py | Python | setup.py | Lanseuo/alasan | 198a340b74429ccab2f4095c39b245936c60ea4c | [
"MIT"
] | null | null | null | setup.py | Lanseuo/alasan | 198a340b74429ccab2f4095c39b245936c60ea4c | [
"MIT"
] | 5 | 2020-05-10T12:03:03.000Z | 2020-05-10T12:04:40.000Z | setup.py | Lanseuo/alasan | 198a340b74429ccab2f4095c39b245936c60ea4c | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="alasan",
version="0.0.1",
author="Lucas Hild",
author_email="contact@lucas-hild.de",
description="Alasan helps you build Alexa skills on AWS Lambda using Python.",
long_de... | 26.863636 | 82 | 0.680203 | from setuptools import setup, find_packages
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="alasan",
version="0.0.1",
author="Lucas Hild",
author_email="contact@lucas-hild.de",
description="Alasan helps you build Alexa skills on AWS Lambda using Python.",
long_de... | true | true |
f7365b4272faa183cad3252dfec1668c82b1770d | 599 | py | Python | var/spack/repos/builtin/packages/perl-math-cdf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/perl-math-cdf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/perl-math-cdf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 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)
from spack.package import *
class PerlMathCdf(PerlPackage):
"""Generate probabilities and quantiles from several sta... | 35.235294 | 93 | 0.749583 |
from spack.package import *
class PerlMathCdf(PerlPackage):
homepage = "https://metacpan.org/pod/Math::CDF"
url = "http://search.cpan.org/CPAN/authors/id/C/CA/CALLAHAN/Math-CDF-0.1.tar.gz"
version('0.1', sha256='7896bf250835ce47dcc813cb8cf9dc576c5455de42e822dcd7d8d3fef2125565')
| true | true |
f7365b43e013e39a7186f6896627308675c2098b | 15,826 | py | Python | vyper/context/types/bases.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | 1 | 2020-07-04T01:47:26.000Z | 2020-07-04T01:47:26.000Z | vyper/context/types/bases.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | vyper/context/types/bases.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | import copy
from collections import OrderedDict
from enum import Enum
from typing import Any, Dict, Optional, Tuple, Type, Union
from vyper import ast as vy_ast
from vyper.context.types.abstract import AbstractDataType
from vyper.exceptions import (
CompilerPanic,
ImmutableViolation,
InvalidLiteral,
In... | 32.166667 | 91 | 0.625174 | import copy
from collections import OrderedDict
from enum import Enum
from typing import Any, Dict, Optional, Tuple, Type, Union
from vyper import ast as vy_ast
from vyper.context.types.abstract import AbstractDataType
from vyper.exceptions import (
CompilerPanic,
ImmutableViolation,
InvalidLiteral,
In... | true | true |
f7365b6614a2b2f2a73eeb08494f8f98110af4db | 9,560 | py | Python | mars/dataframe/datastore/tests/test_datastore_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/dataframe/datastore/tests/test_datastore_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/datastore/tests/test_datastore_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding 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 a... | 39.341564 | 104 | 0.598954 |
import os
import tempfile
import unittest
import numpy as np
import pandas as pd
import mars.dataframe as md
from mars.config import option_context
from mars.dataframe import DataFrame
from mars.deploy.local.core import new_cluster
from mars.session import new_session
from mars.tests.core import TestBas... | true | true |
f7365c6d507efee3fdb9f656365455527ac25a4f | 5,172 | py | Python | setup.py | Eothred/pymad | f560239325452adbb1d37b6408f275ac03674069 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2015-01-21T07:36:11.000Z | 2020-05-29T12:18:33.000Z | setup.py | Eothred/pymad | f560239325452adbb1d37b6408f275ac03674069 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-03-22T02:24:57.000Z | 2015-10-15T15:50:51.000Z | setup.py | Eothred/pymad | f560239325452adbb1d37b6408f275ac03674069 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-02-08T16:55:01.000Z | 2017-02-08T16:55:01.000Z | #-------------------------------------------------------------------------------
# This file is part of PyMad.
#
# Copyright (c) 2011, CERN. 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... | 35.424658 | 80 | 0.642691 |
try:
import pkg_resources
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension
from distutils.util import get_platform
import sys
from os import path
PYMADVERSION=(0, 9)
try:
from Cython.Build import cython... | true | true |
f7365c9b7c7c285ab21ee7e4bac00b72277fcf50 | 122 | py | Python | pypro/modulos/context_processors.py | wosubtil/curso-django | 4673e71fbbec062c74dfaf866ff13b81383e3fcc | [
"MIT"
] | null | null | null | pypro/modulos/context_processors.py | wosubtil/curso-django | 4673e71fbbec062c74dfaf866ff13b81383e3fcc | [
"MIT"
] | 806 | 2020-09-18T11:26:48.000Z | 2022-03-31T00:43:46.000Z | pypro/modulos/context_processors.py | taniodev/curso-django | aa5b0edd6ca55d2ea7f73220644d5c64a96c60df | [
"MIT"
] | 1 | 2020-08-06T19:50:33.000Z | 2020-08-06T19:50:33.000Z | from pypro.modulos import facade
def listar_modulos(request):
return {'MODULOS': facade.listar_modulos_ordenados()}
| 20.333333 | 57 | 0.778689 | from pypro.modulos import facade
def listar_modulos(request):
return {'MODULOS': facade.listar_modulos_ordenados()}
| true | true |
f7365cf7cf02c8871fff6ab4ece9ab8717635813 | 7,703 | py | Python | roms/tests/joy/spadtest-nes-0.01/tools/pilbmp2nes.py | MrKOSMOS/ANESE | 8ae814d615479b1496c98033a1f5bc4da5921c6f | [
"MIT"
] | 349 | 2017-11-15T22:51:00.000Z | 2022-03-21T13:43:57.000Z | tools/pilbmp2nes.py | pubby/Ralph-4 | dcda1d3e5bce25ca22b54dfee82eb64625d64d25 | [
"CC-BY-4.0"
] | 12 | 2018-08-28T21:38:29.000Z | 2021-12-11T16:24:36.000Z | tools/pilbmp2nes.py | pubby/Ralph-4 | dcda1d3e5bce25ca22b54dfee82eb64625d64d25 | [
"CC-BY-4.0"
] | 28 | 2018-06-10T07:31:13.000Z | 2022-03-21T10:54:26.000Z | #!/usr/bin/env python
#
# Bitmap to multi-console CHR converter using PIL or Pillow
#
# Copyright 2014 Damian Yerrick
# Copying and distribution of this file, with or without
# modification, are permitted in any medium without royalty
# provided the copyright notice and this notice are preserved.
# This file is offered... | 36.164319 | 124 | 0.589251 |
from __future__ import with_statement, print_function, unicode_literals
from PIL import Image
from time import sleep
import array
try:
xrange
except NameError:
xrange = range
try:
raw_input
except NameError:
raw_input = input
try:
next
except NameError:
next = lambda x: x.next()
def ... | true | true |
f7365d1f3a6d608c0c9d0eddaeb0a2bb1cb6cb4f | 34,363 | py | Python | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 1 | 2021-09-07T18:51:21.000Z | 2021-09-07T18:51:21.000Z | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 1 | 2020-08-08T03:56:56.000Z | 2020-08-08T03:56:56.000Z | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 1 | 2022-02-16T18:23:11.000Z | 2022-02-16T18:23:11.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 51.059435 | 198 | 0.74359 |
import unittest
from unittest import mock
from azure.cli.command_modules.appservice.static_sites import \
list_staticsites, show_staticsite, delete_staticsite, create_staticsites, CLIError, disconnect_staticsite, \
reconnect_staticsite, list_staticsite_environments, show_staticsite_environment, list_static... | true | true |
f7365d53fe98443b87d6023ffdb580ca656c6f9e | 11,556 | py | Python | pybind/nos/v7_1_0/interface/hundredgigabitethernet/switchport/trunk/native_vlan_classification/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/switchport/trunk/native_vlan_classification/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/switchport/trunk/native_vlan_classification/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 69.614458 | 765 | 0.74325 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f7365d8061a9e85e36743d404f9c4c05f4c8e0b7 | 7,967 | py | Python | boris/eyeparse.py | eacooper/BerkeleyVisionStats | 39192eca0ade05f8a1473cd8032b08c2a1c19e7b | [
"MIT"
] | null | null | null | boris/eyeparse.py | eacooper/BerkeleyVisionStats | 39192eca0ade05f8a1473cd8032b08c2a1c19e7b | [
"MIT"
] | 12 | 2015-01-06T19:16:17.000Z | 2015-01-14T02:03:23.000Z | boris/eyeparse.py | eacooper/BerkeleyVisionStats | 39192eca0ade05f8a1473cd8032b08c2a1c19e7b | [
"MIT"
] | null | null | null | """
Classes to parse NDS files and create pandas DataFrames to hold eyetracking information.
"""
import numpy as np
import pandas as pd
class EyeDataParser(object):
def __init__(self, data_fpath):
self.data_fpath = data_fpath
# Make dictionaries to hold our data with repitions as keys
s... | 32.386179 | 169 | 0.595205 | """
Classes to parse NDS files and create pandas DataFrames to hold eyetracking information.
"""
import numpy as np
import pandas as pd
class EyeDataParser(object):
def __init__(self, data_fpath):
self.data_fpath = data_fpath
self._task_data = {}
self._radial_target_data = {}
... | false | true |
f7365d92e887d736d34915010ba1e65faa113d42 | 7,874 | py | Python | software/Navigator/astar/astar.py | ShenMiaozhang/GAAS | 5c3b8c684e72fdf7f62c5731a260021e741069e7 | [
"BSD-3-Clause"
] | 2 | 2019-04-10T14:04:52.000Z | 2019-05-29T03:41:58.000Z | software/Navigator/astar/astar.py | glider54321/GAAS | 5c3b8c684e72fdf7f62c5731a260021e741069e7 | [
"BSD-3-Clause"
] | null | null | null | software/Navigator/astar/astar.py | glider54321/GAAS | 5c3b8c684e72fdf7f62c5731a260021e741069e7 | [
"BSD-3-Clause"
] | 1 | 2021-12-20T06:54:41.000Z | 2021-12-20T06:54:41.000Z | #encoding=utf-8
import astar_config
import heapq
#from simulator.visualization.config.aircraft_config import aircraft_obj
def gen_aircraft_obj():
ret_val = []
# for i in range(-8, 8):
# for j in range(-8, 8):
# ret_val.append((i, j, 0))
#
# ret_val.append((0, 0, -2))
for i in ... | 34.384279 | 120 | 0.571374 |
import astar_config
import heapq
def gen_aircraft_obj():
ret_val = []
for i in range(-4,4):
for j in range(-4,4):
ret_val.append((i,j,0))
ret_val.append((0, 0, -3))
return ret_val
aircraft_obj = {
"aircraft_points": gen_aircraft_... | false | true |
f7365e5d99eac8285580b730f2f811951fa7ba87 | 1,861 | py | Python | test_runner.py | tmatsuo/appengine-blobstoremigrator-python | c59c84c1a91cdab47489fc4d32ddcf35c579ba6a | [
"Apache-2.0"
] | 12 | 2015-06-10T19:48:45.000Z | 2021-04-15T06:11:01.000Z | test_runner.py | tmatsuo/appengine-blobstoremigrator-python | c59c84c1a91cdab47489fc4d32ddcf35c579ba6a | [
"Apache-2.0"
] | 1 | 2021-03-21T10:33:24.000Z | 2021-03-21T10:33:24.000Z | test_runner.py | tmatsuo/appengine-blobstoremigrator-python | c59c84c1a91cdab47489fc4d32ddcf35c579ba6a | [
"Apache-2.0"
] | 6 | 2016-07-12T02:11:43.000Z | 2021-10-03T00:54:03.000Z | #!/usr/bin/python
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 31.016667 | 78 | 0.73079 |
import os
import sys
import unittest
CUR_DIR = os.path.dirname(__file__)
SRC_DIR = os.path.join(CUR_DIR, 'src')
TEST_DIR = os.path.join(CUR_DIR, 'test')
LIB_DIR = os.path.join(SRC_DIR, 'lib')
def _fix_path():
if SRC_DIR not in sys.path:
sys.path.append(SRC_DIR)
if LIB_DIR not in sys.path:
... | true | true |
f7365eb934ee15b523ebb1bbcdf7881c563276d4 | 18,861 | py | Python | stratipy/filtering_diffusion.py | candleinwindsteve/Stratipy | ea505df1e4830141c590922d654edfbde498b924 | [
"BSD-3-Clause"
] | 1 | 2021-03-08T22:52:19.000Z | 2021-03-08T22:52:19.000Z | stratipy/filtering_diffusion.py | candleinwindsteve/Stratipy | ea505df1e4830141c590922d654edfbde498b924 | [
"BSD-3-Clause"
] | null | null | null | stratipy/filtering_diffusion.py | candleinwindsteve/Stratipy | ea505df1e4830141c590922d654edfbde498b924 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import sys
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import norm
from scipy.io import loadmat, savemat
from nbs_class import Ppi, Patient
from subprocess import call
# import h5py
import os
import glob
import time
import datetime
# NOTE mutationProfileD... | 37.05501 | 118 | 0.600286 |
import sys
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import norm
from scipy.io import loadmat, savemat
from nbs_class import Ppi, Patient
from subprocess import call
import os
import glob
import time
import datetime
def propagation(M, adj, alpha=0.7, tol=10e-6):
print... | true | true |
f73661c09ab447a073f32a96f89585dfb6482f20 | 5,509 | py | Python | src/lib/utils/video.py | HLJ1997/human-action-recognition | 550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0 | [
"MIT"
] | 1 | 2021-07-14T09:15:09.000Z | 2021-07-14T09:15:09.000Z | src/lib/utils/video.py | HLJ1997/human-action-recognition | 550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0 | [
"MIT"
] | null | null | null | src/lib/utils/video.py | HLJ1997/human-action-recognition | 550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0 | [
"MIT"
] | null | null | null | """
Credit to original code https://github.com/tryolabs/norfair/blob/master/norfair/video.py
modified to get output file path as user provided filename suffix and
changed constructor of Video class
"""
import os
import os.path as osp
import time
from typing import List, Optional, Union, Tuple
import cv2
import numpy ... | 36.243421 | 219 | 0.592304 |
import os
import os.path as osp
import time
from typing import List, Optional, Union, Tuple
import cv2
import numpy as np
from rich import print
from rich.progress import BarColumn, Progress, ProgressColumn, TimeRemainingColumn
def get_terminal_size(default: Tuple[int, int] = (80, 24)) -> Tuple[int, int]:
column... | true | true |
f7366281db5c2cbc331075eeeac4051f393c83a9 | 4,294 | py | Python | Self Driving Car/Python with Tensorflow/driveSDC.py | MohammadWasil/Self-Driving-Car | 9ef5b77e1268623c11e4c39d5c8e1e990caee273 | [
"MIT"
] | 7 | 2018-12-19T18:44:02.000Z | 2022-03-18T08:22:43.000Z | Self Driving Car/Python with Tensorflow/driveSDC.py | MohammadWasil/Self-Driving-Car | 9ef5b77e1268623c11e4c39d5c8e1e990caee273 | [
"MIT"
] | null | null | null | Self Driving Car/Python with Tensorflow/driveSDC.py | MohammadWasil/Self-Driving-Car | 9ef5b77e1268623c11e4c39d5c8e1e990caee273 | [
"MIT"
] | 4 | 2019-03-29T14:12:49.000Z | 2021-01-01T15:08:01.000Z | import socket
from tensorflow.keras.models import load_model
from PIL import ImageGrab
import numpy as np
import cv2
import os
#Load the model.
model = load_model(r"D:\Unity Game\Self Driving Car\SDCProgram\Best Models\data-003.h5") # Directory to load the model
# Socket Tcp Connection.
host = "12... | 30.453901 | 148 | 0.6034 | import socket
from tensorflow.keras.models import load_model
from PIL import ImageGrab
import numpy as np
import cv2
import os
model = load_model(r"D:\Unity Game\Self Driving Car\SDCProgram\Best Models\data-003.h5")
host = "127.0.0.1"
port = 25001
ket(socket.AF_INET, socket.SOCK_STREA... | true | true |
f736631eac1f687cc72652145a76d0e53fa16fc2 | 4,127 | py | Python | fiasco/element.py | fluxtransport/fiasco | 9d70d8bdb03197be1ddfd433e1392e214a1468e8 | [
"BSD-3-Clause"
] | null | null | null | fiasco/element.py | fluxtransport/fiasco | 9d70d8bdb03197be1ddfd433e1392e214a1468e8 | [
"BSD-3-Clause"
] | null | null | null | fiasco/element.py | fluxtransport/fiasco | 9d70d8bdb03197be1ddfd433e1392e214a1468e8 | [
"BSD-3-Clause"
] | null | null | null | """
Classes and functions for element-level operations
"""
import numpy as np
import astropy.units as u
import plasmapy
import fiasco
__all__ = ['Element']
class Element(fiasco.IonCollection):
"""
Collection of all ions for a particular element.
The `Element` object provides a way to logically group to... | 33.282258 | 99 | 0.620305 | import numpy as np
import astropy.units as u
import plasmapy
import fiasco
__all__ = ['Element']
class Element(fiasco.IonCollection):
@u.quantity_input
def __init__(self, element_name, temperature: u.K, **kwargs):
if type(element_name) is str:
element_name = element_name.capitalize()
... | true | true |
f73663f3d443c0c444771b600f5712a2e9d729ec | 983 | py | Python | whoahqa/tests/models/test_reporting_period_factory.py | onaio/who-adolescent-hqa | 108a7e60b025d0723247f5f02eab2c4d41f5a02a | [
"Apache-2.0"
] | null | null | null | whoahqa/tests/models/test_reporting_period_factory.py | onaio/who-adolescent-hqa | 108a7e60b025d0723247f5f02eab2c4d41f5a02a | [
"Apache-2.0"
] | 2 | 2018-01-09T08:58:11.000Z | 2019-01-18T09:20:14.000Z | whoahqa/tests/models/test_reporting_period_factory.py | onaio/who-adolescent-hqa | 108a7e60b025d0723247f5f02eab2c4d41f5a02a | [
"Apache-2.0"
] | null | null | null | import datetime
from pyramid import testing
from whoahqa.models import (
DBSession,
ReportingPeriodFactory,
ReportingPeriod,)
from whoahqa.tests.test_base import TestBase
class TestReportingPeriodFactory(TestBase):
def test_get_item_retrieves_by_id(self):
period = ReportingPeriod(
... | 29.787879 | 64 | 0.677518 | import datetime
from pyramid import testing
from whoahqa.models import (
DBSession,
ReportingPeriodFactory,
ReportingPeriod,)
from whoahqa.tests.test_base import TestBase
class TestReportingPeriodFactory(TestBase):
def test_get_item_retrieves_by_id(self):
period = ReportingPeriod(
... | true | true |
f7366410d3402dde7686f8ca4b30c6c1c2234403 | 52,914 | py | Python | models/new/sencebgan.py | yigitozgumus/Polimi_Thesis | 711c1edcf1fdb92fc6c15bf5ab1be141c13995c3 | [
"MIT"
] | 3 | 2019-07-27T14:00:42.000Z | 2020-01-17T17:07:51.000Z | models/new/sencebgan.py | yigitozgumus/Polimi_Thesis | 711c1edcf1fdb92fc6c15bf5ab1be141c13995c3 | [
"MIT"
] | null | null | null | models/new/sencebgan.py | yigitozgumus/Polimi_Thesis | 711c1edcf1fdb92fc6c15bf5ab1be141c13995c3 | [
"MIT"
] | 4 | 2019-10-22T02:58:26.000Z | 2020-10-06T09:59:26.000Z | import tensorflow as tf
from base.base_model import BaseModel
from utils.alad_utils import get_getter
import utils.alad_utils as sn
class SENCEBGAN(BaseModel):
def __init__(self, config):
super(SENCEBGAN, self).__init__(config)
self.build_model()
self.init_saver()
def build_model(sel... | 46.785146 | 100 | 0.501191 | import tensorflow as tf
from base.base_model import BaseModel
from utils.alad_utils import get_getter
import utils.alad_utils as sn
class SENCEBGAN(BaseModel):
def __init__(self, config):
super(SENCEBGAN, self).__init__(config)
self.build_model()
self.init_saver()
def build_model(sel... | true | true |
f7366460f1bafd203830c13ee2d0e7ade440377d | 643 | py | Python | lfd/environment/settings.py | def670/lfd | 9fef15f556cba49dd4b42c0c29505a4137f95fc5 | [
"BSD-2-Clause"
] | 36 | 2015-05-22T14:47:18.000Z | 2021-07-27T15:30:36.000Z | lfd/environment/settings.py | jeffmahler/lfd | ecc6b934db098c0b1af9946454917b6dc911cb74 | [
"BSD-2-Clause"
] | null | null | null | lfd/environment/settings.py | jeffmahler/lfd | ecc6b934db098c0b1af9946454917b6dc911cb74 | [
"BSD-2-Clause"
] | 13 | 2015-05-22T15:38:07.000Z | 2021-07-28T03:20:35.000Z | #:
GRIPPER_OPEN_CLOSE_THRESH = 0.04 # .06 for fig8 (thick rope), 0.04 for thin rope (overhand)
#:
ROPE_RADIUS = .005
#:
ROPE_ANG_STIFFNESS = .1
#:
ROPE_ANG_DAMPING = 1
#:
ROPE_LIN_DAMPING = .75
#:
ROPE_ANG_LIMIT = .4
#:
ROPE_LIN_STOP_ERP = .2
#:
ROPE_MASS = 1.0
#:
ROPE_RADIUS_THICK = .008
#:... | 19.484848 | 91 | 0.623639 |
GRIPPER_OPEN_CLOSE_THRESH = 0.04
ROPE_RADIUS = .005
ROPE_ANG_STIFFNESS = .1
ROPE_ANG_DAMPING = 1
ROPE_LIN_DAMPING = .75
ROPE_ANG_LIMIT = .4
ROPE_LIN_STOP_ERP = .2
ROPE_MASS = 1.0
ROPE_RADIUS_THICK = .008
WINDOW_PROP = [0,0,1500,1500]
#: transposed homogeneous matrix for the viewer... | true | true |
f73664dacc4254f6f4f4b817608a0cf649c590b6 | 198 | py | Python | 020.py | liuyang1/euler | ba6c79b3f809711eec07a7843ec60c86990564d1 | [
"MIT"
] | null | null | null | 020.py | liuyang1/euler | ba6c79b3f809711eec07a7843ec60c86990564d1 | [
"MIT"
] | null | null | null | 020.py | liuyang1/euler | ba6c79b3f809711eec07a7843ec60c86990564d1 | [
"MIT"
] | null | null | null |
def factorial(n):
l = range(1,n+1)
import operator
return reduce(operator.mul,l,1)
def sumDigit(n):
s = str(n)
return sum([int(i) for i in s])
print sumDigit(factorial(100))
| 15.230769 | 35 | 0.621212 |
def factorial(n):
l = range(1,n+1)
import operator
return reduce(operator.mul,l,1)
def sumDigit(n):
s = str(n)
return sum([int(i) for i in s])
print sumDigit(factorial(100))
| false | true |
f73666fc6d19b1f19d47b390ab17540bd4d53368 | 579 | py | Python | setup.py | hanhha/console_ui | 4fd3d37367bc23316620d5ad76666981762fb344 | [
"MIT"
] | 1 | 2022-02-04T03:20:31.000Z | 2022-02-04T03:20:31.000Z | setup.py | alimogh/console_ui | 4fd3d37367bc23316620d5ad76666981762fb344 | [
"MIT"
] | null | null | null | setup.py | alimogh/console_ui | 4fd3d37367bc23316620d5ad76666981762fb344 | [
"MIT"
] | 1 | 2022-02-04T03:22:03.000Z | 2022-02-04T03:22:03.000Z | #!/usr/bin/env python3
from setuptools import setup
import sys
if sys.version_info < (3,0):
sys.exit ("Python version < 3.0 is not supported")
elif sys.version_info < (3,6):
print ("Using Python version < 3.6 would cause issue relevant to the order of windows generated")
setup (name = 'console_ui',
version = '1... | 28.95 | 98 | 0.668394 |
from setuptools import setup
import sys
if sys.version_info < (3,0):
sys.exit ("Python version < 3.0 is not supported")
elif sys.version_info < (3,6):
print ("Using Python version < 3.6 would cause issue relevant to the order of windows generated")
setup (name = 'console_ui',
version = '1.0',
py_modules=['w... | true | true |
f736674bc693ddff36470a5c55535e91fbce24e8 | 1,355 | py | Python | src/spn/experiments/AQP/leaves/static/InferenceRange.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 199 | 2018-11-13T10:37:45.000Z | 2022-02-06T17:07:28.000Z | src/spn/experiments/AQP/leaves/static/InferenceRange.py | minimrbanana/SPFlow | 32233bf29d107c62f0f727b0e64aaa74b37cfe1e | [
"Apache-2.0"
] | 46 | 2018-11-30T13:40:38.000Z | 2022-01-22T21:05:07.000Z | src/spn/experiments/AQP/leaves/static/InferenceRange.py | minimrbanana/SPFlow | 32233bf29d107c62f0f727b0e64aaa74b37cfe1e | [
"Apache-2.0"
] | 78 | 2018-11-13T10:37:48.000Z | 2022-03-14T21:34:13.000Z | """
Created on June 21, 2018
@author: Moritz
"""
import numpy as np
from spn.algorithms.Inference import add_node_likelihood
from spn.experiments.AQP.leaves.static.StaticNumeric import StaticNumeric
def static_likelihood_range(node, ranges, dtype=np.float64, **kwargs):
assert len(node.scope) == 1, node.scope
... | 25.092593 | 106 | 0.647232 |
import numpy as np
from spn.algorithms.Inference import add_node_likelihood
from spn.experiments.AQP.leaves.static.StaticNumeric import StaticNumeric
def static_likelihood_range(node, ranges, dtype=np.float64, **kwargs):
assert len(node.scope) == 1, node.scope
probs = np.ones((ranges.shape[0], 1), dtype=dt... | true | true |
f7366767fdec0eacbd4d0d9376ef997a8cdd4826 | 35,093 | py | Python | sphinx/writers/html.py | PeerHerholz/smobsc | db34d2bb96b80579bd4a3f4c198a6b524c5a134a | [
"BSD-2-Clause"
] | 3 | 2019-06-11T09:42:08.000Z | 2020-03-10T15:57:09.000Z | sphinx/writers/html.py | PeerHerholz/smobsc | db34d2bb96b80579bd4a3f4c198a6b524c5a134a | [
"BSD-2-Clause"
] | 12 | 2019-01-09T15:43:57.000Z | 2020-01-21T10:46:30.000Z | sphinx/writers/html.py | PeerHerholz/smobsc | db34d2bb96b80579bd4a3f4c198a6b524c5a134a | [
"BSD-2-Clause"
] | 10 | 2019-02-04T11:49:35.000Z | 2020-03-21T13:32:20.000Z | """
sphinx.writers.html
~~~~~~~~~~~~~~~~~~~
docutils writers handling Sphinx' custom nodes.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import copy
import os
import posixpath
import sys
import warnings
from typing import Iterable, c... | 37.41258 | 105 | 0.58402 |
import copy
import os
import posixpath
import sys
import warnings
from typing import Iterable, cast
from docutils import nodes
from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator
from sphinx import addnodes
from sphinx.builders import Builder
from sphinx.deprecation import RemovedInSphinx... | true | true |
f7366798202eb5b63a293458869820181b482fe2 | 10,620 | py | Python | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 24 | 2019-12-12T20:54:39.000Z | 2021-03-25T15:40:26.000Z | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2020-10-21T23:01:06.000Z | 2021-04-22T09:59:50.000Z | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2019-12-03T21:05:11.000Z | 2021-04-02T11:41:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - Protocol/Transport layer.
Helper functions.
"""
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):... | 34.14791 | 88 | 0.591149 |
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):
_fields_ = [("dwLowDateTime", ctypes.c_uint), ("dwHighDateTime", ctypes.c_uint)]
def dt_now() -> dt:
... | true | true |
f736682c03031c943fab6c203b47c7184e8ec07d | 12,492 | py | Python | models/resnet_lgdv2.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | models/resnet_lgdv2.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | models/resnet_lgdv2.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
import numpy as np
__all__ = [
'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnet200'
]
def look_bottleneck_global(glo):
... | 32.030769 | 130 | 0.53186 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
import numpy as np
__all__ = [
'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnet200'
]
def look_bottleneck_global(glo):
... | true | true |
f7366835c02e403a339394e5e63ac8c59828af30 | 123 | py | Python | src/Stage/stage4.py | yuduki24/Rikako | 989a0499d06bd37b5a6d826b1fb898369a50bbfb | [
"MIT"
] | null | null | null | src/Stage/stage4.py | yuduki24/Rikako | 989a0499d06bd37b5a6d826b1fb898369a50bbfb | [
"MIT"
] | null | null | null | src/Stage/stage4.py | yuduki24/Rikako | 989a0499d06bd37b5a6d826b1fb898369a50bbfb | [
"MIT"
] | null | null | null | from Stage.stage import *
class Stage4(Stage):
def deployEnemy(self):
Boss2((self.scr_rect.width//2, 200)) | 24.6 | 44 | 0.650407 | from Stage.stage import *
class Stage4(Stage):
def deployEnemy(self):
Boss2((self.scr_rect.width//2, 200)) | true | true |
f73669c910733fc3bbdb968d1c678045f94256d1 | 999 | py | Python | velhot/migrations/0004_profile.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/migrations/0004_profile.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/migrations/0004_profile.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-20 12:48
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 35.678571 | 145 | 0.638639 |
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('velhot', '0003_friend'),
]
opera... | true | true |
f7366a3d5b380afad1909ab74d0d3a13473a6311 | 43,835 | py | Python | statsmodels/tsa/tests/results/arima111nc_css_results.py | yarikoptic/statsmodels | f990cb1a1ef0c9883c9394444e6f9d027efabec6 | [
"BSD-3-Clause"
] | 34 | 2018-07-13T11:30:46.000Z | 2022-01-05T13:48:10.000Z | venv/lib/python3.6/site-packages/statsmodels/tsa/tests/results/arima111nc_css_results.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 6 | 2015-08-28T16:59:03.000Z | 2019-04-12T22:29:01.000Z | venv/lib/python3.6/site-packages/statsmodels/tsa/tests/results/arima111nc_css_results.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 28 | 2015-04-01T20:02:25.000Z | 2021-07-03T00:09:28.000Z | import numpy as np
llf = np.array([-242.89663276735])
nobs = np.array([ 202])
k = np.array([ 3])
k_exog = np.array([ 1])
sigma = np.array([ .8053519404535])
chi2 = np.array([ 15723.381396967])
df_model = np.array([ 2])
k_ar = np.array([ 1])
k... | 34.407378 | 229 | 0.401278 | import numpy as np
llf = np.array([-242.89663276735])
nobs = np.array([ 202])
k = np.array([ 3])
k_exog = np.array([ 1])
sigma = np.array([ .8053519404535])
chi2 = np.array([ 15723.381396967])
df_model = np.array([ 2])
k_ar = np.array([ 1])
k... | true | true |
f7366a7972aa995d6c049ca89cf300ad3dc9460e | 1,234 | py | Python | script.py | DarkDevil1265/Malluunlimitedfilterbot | b8e8795e1c167a40070a9a698802122c461fcfda | [
"MIT"
] | 1 | 2021-09-19T17:49:37.000Z | 2021-09-19T17:49:37.000Z | script.py | DarkDevil1265/Malluunlimitedfilterbot | b8e8795e1c167a40070a9a698802122c461fcfda | [
"MIT"
] | null | null | null | script.py | DarkDevil1265/Malluunlimitedfilterbot | b8e8795e1c167a40070a9a698802122c461fcfda | [
"MIT"
] | 1 | 2021-09-20T08:20:14.000Z | 2021-09-20T08:20:14.000Z | class Script(object):
START_MSG = """<b>Hello {} How are you,
I'm an advanced filter bot with many capabilities!
Made by @RJMALLU
See <i>/help</i> for commands and more details.</b>
"""
HELP_MSG = """
<i>Add me as admin in your group and start filtering :)</i>
<b>Basic Commands;</b>
/start - Check if I'... | 19.903226 | 120 | 0.658023 | class Script(object):
START_MSG = """<b>Hello {} How are you,
I'm an advanced filter bot with many capabilities!
Made by @RJMALLU
See <i>/help</i> for commands and more details.</b>
"""
HELP_MSG = """
<i>Add me as admin in your group and start filtering :)</i>
<b>Basic Commands;</b>
/start - Check if I'... | true | true |
f7366aae6d78051c35f895dfc579f8573f42f546 | 601 | py | Python | docs/examples/lib/gui-tk.py | ivanov/ipython | 62cc379d3b454923cb48e94663f385f54ec806cc | [
"BSD-3-Clause-Clear"
] | 2 | 2015-04-21T12:12:43.000Z | 2015-04-21T12:12:54.000Z | docs/examples/lib/gui-tk.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | 1 | 2015-07-16T22:26:53.000Z | 2015-07-16T22:26:53.000Z | docs/examples/lib/gui-tk.py | 08saikiranreddy/ipython | 3498382180ad409592f46a9dd0d190ca917bfbff | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python
"""Simple Tk example to manually test event loop integration.
This is meant to run tests manually in ipython as:
In [5]: %gui tk
In [6]: %run gui-tk.py
"""
from Tkinter import *
class MyApp:
def __init__(self, root):
frame = Frame(root)
frame.pack()
self.button =... | 18.212121 | 75 | 0.655574 |
"""Simple Tk example to manually test event loop integration.
This is meant to run tests manually in ipython as:
In [5]: %gui tk
In [6]: %run gui-tk.py
"""
from Tkinter import *
class MyApp:
def __init__(self, root):
frame = Frame(root)
frame.pack()
self.button = Button(frame, text="... | false | true |
f7366b93b511f5c29ce318235f5766cca881d088 | 27,114 | py | Python | sphinx/writers/text.py | zzqcn/sphinx-doc | d7adc8efd7f71bb3f1633bf6cde19273fc95b977 | [
"BSD-2-Clause"
] | 2 | 2017-07-05T09:57:33.000Z | 2017-11-14T23:05:53.000Z | sphinx/writers/text.py | zzqcn/sphinx-doc | d7adc8efd7f71bb3f1633bf6cde19273fc95b977 | [
"BSD-2-Clause"
] | 1 | 2019-01-17T14:26:22.000Z | 2019-01-17T22:56:26.000Z | sphinx/writers/text.py | zzqcn/sphinx-doc | d7adc8efd7f71bb3f1633bf6cde19273fc95b977 | [
"BSD-2-Clause"
] | 1 | 2017-08-31T14:33:03.000Z | 2017-08-31T14:33:03.000Z | # -*- coding: utf-8 -*-
"""
sphinx.writers.text
~~~~~~~~~~~~~~~~~~~
Custom docutils writer for plain text.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import textwrap
from itertools import groupby
import warnings
... | 27.667347 | 92 | 0.579996 |
import os
import re
import textwrap
from itertools import groupby
import warnings
from six.moves import zip_longest
from docutils import nodes, writers
from docutils.utils import column_width
from sphinx import addnodes
from sphinx.deprecation import RemovedInSphinx16Warning
from sphinx.locale import admonitionlabe... | true | true |
f7366bb4541a785a76fcbf18c40fbef0d57f5292 | 8,605 | bzl | Python | scala/private/rules/scala_library.bzl | tian000/rules_scala | b3fc6a26db404ce904f98d525ae27a21d3f49f06 | [
"Apache-2.0"
] | null | null | null | scala/private/rules/scala_library.bzl | tian000/rules_scala | b3fc6a26db404ce904f98d525ae27a21d3f49f06 | [
"Apache-2.0"
] | null | null | null | scala/private/rules/scala_library.bzl | tian000/rules_scala | b3fc6a26db404ce904f98d525ae27a21d3f49f06 | [
"Apache-2.0"
] | null | null | null | load("@io_bazel_rules_scala//scala:providers.bzl", "create_scala_provider")
load(
"@io_bazel_rules_scala//scala/private:common.bzl",
"collect_jars",
"collect_srcjars",
"sanitize_string_for_usage",
"write_manifest",
)
load(
"@io_bazel_rules_scala//scala/private:common_attributes.bzl",
"common... | 30.842294 | 142 | 0.708542 | load("@io_bazel_rules_scala//scala:providers.bzl", "create_scala_provider")
load(
"@io_bazel_rules_scala//scala/private:common.bzl",
"collect_jars",
"collect_srcjars",
"sanitize_string_for_usage",
"write_manifest",
)
load(
"@io_bazel_rules_scala//scala/private:common_attributes.bzl",
"common... | true | true |
f7366c0f1b8be7fbd52f8cb9f823f28077e8b0d4 | 2,736 | py | Python | test/nn/conv/test_film_conv.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | 1 | 2022-02-21T13:23:19.000Z | 2022-02-21T13:23:19.000Z | test/nn/conv/test_film_conv.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | null | null | null | test/nn/conv/test_film_conv.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | null | null | null | import torch
from torch_sparse import SparseTensor
from torch_geometric.nn import FiLMConv
def test_film_conv():
x1 = torch.randn(4, 4)
x2 = torch.randn(2, 16)
edge_index = torch.tensor([[0, 1, 1, 2, 2, 3], [0, 0, 1, 0, 1, 1]])
edge_type = torch.tensor([0, 1, 1, 0, 0, 1])
row, col = edge_index
... | 40.235294 | 78 | 0.621711 | import torch
from torch_sparse import SparseTensor
from torch_geometric.nn import FiLMConv
def test_film_conv():
x1 = torch.randn(4, 4)
x2 = torch.randn(2, 16)
edge_index = torch.tensor([[0, 1, 1, 2, 2, 3], [0, 0, 1, 0, 1, 1]])
edge_type = torch.tensor([0, 1, 1, 0, 0, 1])
row, col = edge_index
... | true | true |
f7366dd76a0f042bd795bb1d0879f0ea7217a5ad | 10,253 | py | Python | qa/rpc-tests/listtransactions.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | null | null | null | qa/rpc-tests/listtransactions.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | null | null | null | qa/rpc-tests/listtransactions.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | 2 | 2019-06-28T12:47:30.000Z | 2019-12-16T04:56:50.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import BitcoinTestFramework
from ... | 49.771845 | 113 | 0.598752 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, COIN
from io import BytesIO
def txFromHex(hexstring):
tx = CTransaction()
f = BytesIO(hex_str_to_bytes(hexstring))
tx.deserialize(f)
return tx
class... | true | true |
f7366fb0623d365f2c6a0afdb0e6e6f704b8c08b | 431 | py | Python | output/models/ms_data/element/elem_z003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/element/elem_z003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/element/elem_z003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.element.elem_z003_xsd.elem_z003 import (
AType,
BType,
Container1,
CType,
DType,
EType,
FType,
GType,
A,
B,
C,
Container,
D,
E,
F,
G,
)
__all__ = [
"AType",
"BType",
"Container1",
"CType",
"DType",
"EType... | 11.342105 | 67 | 0.433875 | from output.models.ms_data.element.elem_z003_xsd.elem_z003 import (
AType,
BType,
Container1,
CType,
DType,
EType,
FType,
GType,
A,
B,
C,
Container,
D,
E,
F,
G,
)
__all__ = [
"AType",
"BType",
"Container1",
"CType",
"DType",
"EType... | true | true |
f7366fb79cc98cc8da4a20593adf754830266e3b | 6,539 | py | Python | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 1 | 2021-08-18T13:17:10.000Z | 2021-08-18T13:17:10.000Z | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 7 | 2018-02-18T12:29:20.000Z | 2020-05-14T18:08:48.000Z | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 3 | 2018-02-17T18:27:43.000Z | 2022-01-20T02:28:58.000Z | # -*- coding: utf-8 -*-
"""Base class for all lexers."""
import re
from funcparserlib.lexer import Token
class LexerError(Exception):
"""General lexer error."""
def __init__(self, msg, pos, char, lnum, brace_level, line):
"""Initialise with information on where the error occurred."""
self.m... | 29.32287 | 79 | 0.562777 |
import re
from funcparserlib.lexer import Token
class LexerError(Exception):
def __init__(self, msg, pos, char, lnum, brace_level, line):
self.msg = msg
self.pos = pos
self.char = char
self.lnum = lnum
self.brace_level = brace_level
self.line = line
def __s... | true | true |
f736700ef45c4a87f90b99dc2b55cbaf2bc3c59d | 7,834 | py | Python | main/pronouns.py | LucilleN/MH-Stigma-in-Masked-LMs | 9e30817cb32358a8e6004faf7ef88ad69d6148f6 | [
"MIT"
] | 1 | 2022-03-08T04:45:49.000Z | 2022-03-08T04:45:49.000Z | main/pronouns.py | LucilleN/MH-Stigma-in-Masked-LMs | 9e30817cb32358a8e6004faf7ef88ad69d6148f6 | [
"MIT"
] | null | null | null | main/pronouns.py | LucilleN/MH-Stigma-in-Masked-LMs | 9e30817cb32358a8e6004faf7ef88ad69d6148f6 | [
"MIT"
] | null | null | null | # Comparing He vs She
from transformers import pipeline
import pandas as pd
from utils import diagnoses, get_target_probability, get_top_k, print_stats, plot_male_and_female
import matplotlib.pylab as plt
import seaborn as sns
import argparse
templates = [
"<mask> has [diagnosis]",
"<mask> is diagnosed with [d... | 44.765714 | 132 | 0.659433 |
from transformers import pipeline
import pandas as pd
from utils import diagnoses, get_target_probability, get_top_k, print_stats, plot_male_and_female
import matplotlib.pylab as plt
import seaborn as sns
import argparse
templates = [
"<mask> has [diagnosis]",
"<mask> is diagnosed with [diagnosis]",
"<mas... | true | true |
f73670892a881a9abc5732fb1b106ac4e17ad21b | 18,781 | py | Python | PythonVirtEnv/Lib/site-packages/zmq/_future.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 5 | 2022-01-20T22:59:04.000Z | 2022-02-06T06:11:35.000Z | PythonVirtEnv/Lib/site-packages/zmq/_future.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | PythonVirtEnv/Lib/site-packages/zmq/_future.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | null | null | null | """Future-returning APIs for coroutines."""
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
from collections import namedtuple, deque
from itertools import chain
from typing import Type
from zmq import EVENTS, POLLOUT, POLLIN
import zmq as _zmq
_FutureEvent = namedtuple(... | 33.00703 | 94 | 0.569139 |
from collections import namedtuple, deque
from itertools import chain
from typing import Type
from zmq import EVENTS, POLLOUT, POLLIN
import zmq as _zmq
_FutureEvent = namedtuple('_FutureEvent', ('future', 'kind', 'kwargs', 'msg', 'timer'))
class _AsyncPoller(_zmq.Poller):
_socket_class = None
... | true | true |
f736712970df93b5bef6cd0469bab29486ab504a | 12,232 | py | Python | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | # can't get the output to stop putting extra space after baby name before punctuation.
"""
A Baby class and functions that use/test it.
Authors: Dave Fisher, David Mutchler, Vibha Alangar, Matt Boutell,
Mark Hays, Amanda Stouder, Derek Whitley, their colleagues,
and Seth Mutchler.
""" # DONE: ... | 37.066667 | 86 | 0.563685 |
import random
def main():
print("UN-comment the following TESTS, one by one, when you are ready.")
# UN-comment the following, one by one, when you are ready to TEST.
run_test_1()
run_test_2()
###############################################################################
# Done: 2. In this mod... | true | true |
f736716d567c76b349b3ec264bc0736f0ffae941 | 12,320 | py | Python | trafficmonitor/gui/filter.py | Sumanth007/Traffic-Monitor | 2623f5c03a362b14415620528f05a91aba960374 | [
"MIT"
] | null | null | null | trafficmonitor/gui/filter.py | Sumanth007/Traffic-Monitor | 2623f5c03a362b14415620528f05a91aba960374 | [
"MIT"
] | 1 | 2022-03-22T21:21:19.000Z | 2022-03-22T21:21:19.000Z | trafficmonitor/gui/filter.py | SumanthTirumale/Traffic-Monitor | 2623f5c03a362b14415620528f05a91aba960374 | [
"MIT"
] | null | null | null | from pathlib import Path
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
from PyQt5.Qt import Qt
from PyQt5.QtCore import QDateTime
class Filter(QDialog):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindowTitle("Traffic Monitor")
... | 43.076923 | 116 | 0.688149 | from pathlib import Path
from PyQt5.QtWidgets import *
from PyQt5.QtGui import QIcon
from PyQt5.Qt import Qt
from PyQt5.QtCore import QDateTime
class Filter(QDialog):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setWindowTitle("Traffic Monitor")
... | true | true |
f73671817556bbbd670b8a6f4c8d5928a731b5df | 26,965 | py | Python | envs/simulation/robot.py | cww97/visual-language-grasping | f96404c9997ef55ede07293ce319ca19a39ae5ec | [
"BSD-2-Clause"
] | 3 | 2020-05-08T11:14:21.000Z | 2021-07-09T15:30:01.000Z | envs/simulation/robot.py | cww97/visual-language-grasping | f96404c9997ef55ede07293ce319ca19a39ae5ec | [
"BSD-2-Clause"
] | 4 | 2020-03-10T13:24:43.000Z | 2021-07-13T06:09:03.000Z | envs/simulation/robot.py | cww97/visual-language-grasping | f96404c9997ef55ede07293ce319ca19a39ae5ec | [
"BSD-2-Clause"
] | 1 | 2021-04-23T01:38:46.000Z | 2021-04-23T01:38:46.000Z | import os
import time
import numpy as np
import yaml
import utils
from . import vrep
from ..robot import Robot as BaseRobot
from ..robot import Reward
from ..data import Data as TextData
import random
from bisect import bisect_right
import cv2
import os
class SimRobot(BaseRobot):
def __init__(self, obj_mesh_dir, n... | 49.568015 | 323 | 0.744113 | import os
import time
import numpy as np
import yaml
import utils
from . import vrep
from ..robot import Robot as BaseRobot
from ..robot import Reward
from ..data import Data as TextData
import random
from bisect import bisect_right
import cv2
import os
class SimRobot(BaseRobot):
def __init__(self, obj_mesh_dir, n... | true | true |
f7367350088cb16efe08739ab429a004915de773 | 3,613 | py | Python | nwnodedetector/nwocrsounds.py | wesh92/nwnodetool | 1c79418d9ad0f1f22dfbc6aab390ca9603fb1596 | [
"Apache-2.0"
] | null | null | null | nwnodedetector/nwocrsounds.py | wesh92/nwnodetool | 1c79418d9ad0f1f22dfbc6aab390ca9603fb1596 | [
"Apache-2.0"
] | null | null | null | nwnodedetector/nwocrsounds.py | wesh92/nwnodetool | 1c79418d9ad0f1f22dfbc6aab390ca9603fb1596 | [
"Apache-2.0"
] | null | null | null | """
New World OCR Node Detector
Created: 2021-10-07
Dev: Wes H.
Uses OCR to get coordinates from top right of the NW game window
and imposes that against a list of possible nodes.
When you're close to one it will play a bell noise!
"""
import winsound
from PIL import ImageGrab, ImageOps, Image
import pytesseract
impor... | 34.740385 | 139 | 0.575699 | import winsound
from PIL import ImageGrab, ImageOps, Image
import pytesseract
import psutil
from time import sleep
import pathlib
import iron_markers as imark
import essence_markers as emark
import chest_essence as ce
import numpy as np
localpath = str(pathlib.Path(__file__).parent.resolve())
pytesseract.pytesseract.... | true | true |
f73673a5069a8351aaff5f959c4efb2b38cc83ca | 5,325 | py | Python | models/Conversation.py | amstee/NeoRestAPI | 9c0e28a82ae0d23bab03993340df73383a9454af | [
"Apache-2.0"
] | 3 | 2018-09-20T16:27:39.000Z | 2019-10-29T23:35:14.000Z | models/Conversation.py | amstee/NeoRestAPI | 9c0e28a82ae0d23bab03993340df73383a9454af | [
"Apache-2.0"
] | 1 | 2021-02-08T20:23:30.000Z | 2021-02-08T20:23:30.000Z | models/Conversation.py | amstee/NeoRestAPI | 9c0e28a82ae0d23bab03993340df73383a9454af | [
"Apache-2.0"
] | null | null | null | from config.database import db
from dateutil import parser as DateParser
from flask_socketio import emit
from utils.log import logger_set
import datetime
from config.log import LOG_DATABASE_FILE
from mobile import push_ios as ios
from mobile import push_android as android
logger = logger_set(module=__name__, ... | 39.738806 | 118 | 0.53277 | from config.database import db
from dateutil import parser as DateParser
from flask_socketio import emit
from utils.log import logger_set
import datetime
from config.log import LOG_DATABASE_FILE
from mobile import push_ios as ios
from mobile import push_android as android
logger = logger_set(module=__name__, ... | true | true |
f73674f40aed7730a8358cff7e32e4a5302acb86 | 8,699 | py | Python | old/track-customers-4 - tweaks.py | broxeph/ameryn | e1289c280ca865ec84625b712adc52c536b4b174 | [
"MIT"
] | null | null | null | old/track-customers-4 - tweaks.py | broxeph/ameryn | e1289c280ca865ec84625b712adc52c536b4b174 | [
"MIT"
] | null | null | null | old/track-customers-4 - tweaks.py | broxeph/ameryn | e1289c280ca865ec84625b712adc52c536b4b174 | [
"MIT"
] | null | null | null | """
Add tracks to customer orders.
(c) Ameryn Media LLC, 2015. All rights reserved.
"""
import wave, os, pydub, datetime, struct
import multiprocessing
import csv
import shutil
# Input file parameters (name & location)
input_filename_series = False
input_whole_folder = True
input_filename = '4-track.wav'
input_filena... | 42.024155 | 163 | 0.587769 | """
Add tracks to customer orders.
(c) Ameryn Media LLC, 2015. All rights reserved.
"""
import wave, os, pydub, datetime, struct
import multiprocessing
import csv
import shutil
input_filename_series = False
input_whole_folder = True
input_filename = '4-track.wav'
input_filename_list_range = ('00106', '00109-2')
inpu... | false | true |
f73674fecfcfecd4c0550bfc2dbcbb507f581464 | 9,561 | py | Python | test/comparison/v1/REF_M_30806+30807+30808_Specular_all_set_1.py | jenest/reflectivity_ui | 9fc746e1729d57268c621e6a655b5022fba3af8b | [
"Apache-2.0"
] | 1 | 2017-11-19T22:23:13.000Z | 2017-11-19T22:23:13.000Z | test/comparison/v1/REF_M_30806+30807+30808_Specular_all_set_1.py | mdoucet/reflectivity_ui | aa646e6f8ad91eaedf70ec7b9230e79970e3cdf0 | [
"Apache-2.0"
] | 3 | 2020-05-28T13:29:53.000Z | 2021-07-14T21:37:32.000Z | test/comparison/v1/REF_M_30806+30807+30808_Specular_all_set_1.py | mdoucet/reflectivity_ui | aa646e6f8ad91eaedf70ec7b9230e79970e3cdf0 | [
"Apache-2.0"
] | 1 | 2021-06-09T15:12:07.000Z | 2021-06-09T15:12:07.000Z | # Cross-section: Off_Off
# Run:30806
######################################################################
#Python Script Generated by GeneratePythonScript Algorithm
######################################################################
LoadEventNexus(Filename='/SNS/REF_M/IPTS-21391/nexus/REF_M_30794.nxs.h5',
... | 56.573964 | 77 | 0.448279 | true | true | |
f7367526b246e8930080e23b35f47d510ab893d1 | 5,922 | py | Python | Python/venv/lib/python3.7/site-packages/IPython/terminal/ptutils.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | null | null | null | Python/venv/lib/python3.7/site-packages/IPython/terminal/ptutils.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 1 | 2020-03-16T07:10:32.000Z | 2020-03-16T07:10:32.000Z | Python/venv/lib/python3.7/site-packages/IPython/terminal/ptutils.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | null | null | null | """prompt-toolkit utilities
Everything in this module is a private API,
not to be used outside IPython.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import unicodedata
from wcwidth import wcwidth
from IPython.core.completer import (
provisionalcomplete... | 37.245283 | 148 | 0.631712 |
import unicodedata
from wcwidth import wcwidth
from IPython.core.completer import (
provisionalcompleter, cursor_to_position,
_deduplicate_completions)
from prompt_toolkit.completion import Completer, Completion
from prompt_toolkit.lexers import Lexer
from prompt_toolkit.lexers import PygmentsLexer
from pr... | true | true |
f73675bb454e512b33aeba15ea4bcbf27706c67c | 3,113 | py | Python | Scripts/read_msp.py | ljocha/DeepEI | 96aee49192ac805dda7971041c01e16c62cd3cbc | [
"Apache-2.0"
] | null | null | null | Scripts/read_msp.py | ljocha/DeepEI | 96aee49192ac805dda7971041c01e16c62cd3cbc | [
"Apache-2.0"
] | null | null | null | Scripts/read_msp.py | ljocha/DeepEI | 96aee49192ac805dda7971041c01e16c62cd3cbc | [
"Apache-2.0"
] | 1 | 2022-01-12T10:52:30.000Z | 2022-01-12T10:52:30.000Z | from DeepEI.utils import ms2vec, get_cdk_fingerprints, get_cdk_descriptors
from matchms.importing import load_from_msp
import json
import numpy as np
from scipy.sparse import csr_matrix, save_npz
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.rdMolDescriptors import CalcExactMolWt
# incompatible... | 28.559633 | 81 | 0.712817 | from DeepEI.utils import ms2vec, get_cdk_fingerprints, get_cdk_descriptors
from matchms.importing import load_from_msp
import json
import numpy as np
from scipy.sparse import csr_matrix, save_npz
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.rdMolDescriptors import CalcExactMolWt
from concur... | true | true |
f73675de7d4f1ed4ca073bbdca3fc505c9bee00a | 1,629 | py | Python | ish_parser/Components/SkyCoverComponent.py | vtoupet/ish_parser | 121b553937c89f14ab7af62f7daaf301f18c0aa8 | [
"MIT"
] | 52 | 2015-02-02T21:52:58.000Z | 2022-03-03T12:38:44.000Z | ish_parser/Components/SkyCoverComponent.py | vtoupet/ish_parser | 121b553937c89f14ab7af62f7daaf301f18c0aa8 | [
"MIT"
] | 19 | 2015-07-27T13:34:01.000Z | 2021-07-23T14:01:41.000Z | ish_parser/Components/SkyCoverComponent.py | vtoupet/ish_parser | 121b553937c89f14ab7af62f7daaf301f18c0aa8 | [
"MIT"
] | 31 | 2015-05-13T03:24:55.000Z | 2021-07-20T12:53:44.000Z | from ..Distance import Distance
from ..CloudCoverage import CloudCoverage
from ..Constant import Constant
from .BaseComponent import BaseComponent
class SkyCoverComponent(BaseComponent):
''' handle GA1..GA8 sky component types '''
CLOUD_TYPES = {
"00": "Cirrus (Ci)",
"01": "Cirrocumulus (Cc)",
"02": "... | 32.58 | 80 | 0.622468 | from ..Distance import Distance
from ..CloudCoverage import CloudCoverage
from ..Constant import Constant
from .BaseComponent import BaseComponent
class SkyCoverComponent(BaseComponent):
CLOUD_TYPES = {
"00": "Cirrus (Ci)",
"01": "Cirrocumulus (Cc)",
"02": "Cirrostratus (Cs)",
"03": "Altocumulus (Ac... | true | true |
f736780580822402f201e833c99571db43c8978d | 17,290 | py | Python | src/waldur_mastermind/marketplace/tests/test_order_items.py | virtengine/ve-waldur-v2 | c9d90bc659171de678bd552e92cfc59cffb6fc3a | [
"MIT"
] | 2 | 2018-08-16T14:42:24.000Z | 2019-07-20T03:36:59.000Z | src/waldur_mastermind/marketplace/tests/test_order_items.py | virtengine/ve-waldur-v2 | c9d90bc659171de678bd552e92cfc59cffb6fc3a | [
"MIT"
] | null | null | null | src/waldur_mastermind/marketplace/tests/test_order_items.py | virtengine/ve-waldur-v2 | c9d90bc659171de678bd552e92cfc59cffb6fc3a | [
"MIT"
] | 3 | 2019-02-27T19:17:49.000Z | 2019-07-25T21:40:01.000Z | import unittest
from ddt import data, ddt
from django.core.exceptions import ValidationError
from rest_framework import status, test
from waldur_core.quotas import signals as quota_signals
from waldur_core.structure.tests import fixtures as structure_fixtures
from waldur_mastermind.marketplace import models
from wald... | 38.59375 | 101 | 0.688664 | import unittest
from ddt import data, ddt
from django.core.exceptions import ValidationError
from rest_framework import status, test
from waldur_core.quotas import signals as quota_signals
from waldur_core.structure.tests import fixtures as structure_fixtures
from waldur_mastermind.marketplace import models
from wald... | true | true |
f7367865c9e793d8304154e17a20b6e94a107b97 | 3,087 | py | Python | readthedocs/rtd_tests/tests/test_version_commit_name.py | mforbes/readthedocs.org | 92f6224a67648a6d27e7a295973c2718d07cee11 | [
"MIT"
] | 4,054 | 2015-01-01T00:58:07.000Z | 2019-06-28T05:50:49.000Z | readthedocs/rtd_tests/tests/test_version_commit_name.py | mforbes/readthedocs.org | 92f6224a67648a6d27e7a295973c2718d07cee11 | [
"MIT"
] | 4,282 | 2015-01-01T21:38:49.000Z | 2019-06-28T15:41:00.000Z | readthedocs/rtd_tests/tests/test_version_commit_name.py | mforbes/readthedocs.org | 92f6224a67648a6d27e7a295973c2718d07cee11 | [
"MIT"
] | 3,224 | 2015-01-01T07:38:45.000Z | 2019-06-28T09:19:10.000Z | # -*- coding: utf-8 -*-
from django.test import TestCase
from django_dynamic_fixture import get, new
from readthedocs.builds.constants import (
BRANCH,
LATEST,
STABLE,
TAG,
EXTERNAL,
)
from readthedocs.builds.models import Version
from readthedocs.projects.constants import REPO_TYPE_GIT, REPO_TYPE_... | 34.3 | 70 | 0.649822 |
from django.test import TestCase
from django_dynamic_fixture import get, new
from readthedocs.builds.constants import (
BRANCH,
LATEST,
STABLE,
TAG,
EXTERNAL,
)
from readthedocs.builds.models import Version
from readthedocs.projects.constants import REPO_TYPE_GIT, REPO_TYPE_HG
from readthedocs.pro... | true | true |
f736799f40ea5a3700c14af04a10d7f61032ff9a | 877 | py | Python | src/util/SetInterval.py | gekkyo/dendai_ict | 87fd9b9ba028d81d6f87b0fa4af864584e9eb5e2 | [
"CC0-1.0"
] | null | null | null | src/util/SetInterval.py | gekkyo/dendai_ict | 87fd9b9ba028d81d6f87b0fa4af864584e9eb5e2 | [
"CC0-1.0"
] | 1 | 2022-03-12T01:02:07.000Z | 2022-03-12T01:02:07.000Z | src/util/SetInterval.py | gekkyo/dendai_ict | 87fd9b9ba028d81d6f87b0fa4af864584e9eb5e2 | [
"CC0-1.0"
] | null | null | null | import logging
import threading
import time
from typing import Any
class SetInterval:
def __init__(self, interval: float, action: Any) -> None:
"""コンストラクタ
Args:
interval (float): 呼び出し間隔
action (Any): 呼ぶ出す関数
"""
logging.info("init")
self.interval = i... | 25.057143 | 66 | 0.573546 | import logging
import threading
import time
from typing import Any
class SetInterval:
def __init__(self, interval: float, action: Any) -> None:
logging.info("init")
self.interval = interval
self.action = action
self.stopEvent = threading.Event()
self.thread = threading.Thr... | true | true |
f73679d2fdec17980b144382204db90235445606 | 10,093 | py | Python | runtime.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | runtime.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | runtime.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | import ctypes
import enum
import os
import sys
class _Structure(ctypes.Structure):
def cptr(self):
return ctypes.pointer(self)
def __str__(self):
strs = []
for k in [m for m in dir(self) if (m[0] != '_') and (m != 'cptr')]:
s = getattr(self, k)
if 'c_int_Array' in type(s).__name__:
... | 45.669683 | 162 | 0.705439 | import ctypes
import enum
import os
import sys
class _Structure(ctypes.Structure):
def cptr(self):
return ctypes.pointer(self)
def __str__(self):
strs = []
for k in [m for m in dir(self) if (m[0] != '_') and (m != 'cptr')]:
s = getattr(self, k)
if 'c_int_Array' in type(s).__name__:
... | false | true |
f73679f388fc6181a9a6b17c30d5729b89190c20 | 147 | py | Python | pinax/cart/models/cart.py | pinax/pinax-cart | 5a99c47ba8ce314f3a760717833cd5f4f5cf532f | [
"MIT"
] | 2 | 2015-12-15T22:49:54.000Z | 2016-09-01T12:50:07.000Z | pinax/cart/models/cart.py | pinax/pinax-cart | 5a99c47ba8ce314f3a760717833cd5f4f5cf532f | [
"MIT"
] | 3 | 2019-03-01T17:33:40.000Z | 2019-03-31T00:38:52.000Z | pinax/cart/models/cart.py | pinax/pinax-cart | 5a99c47ba8ce314f3a760717833cd5f4f5cf532f | [
"MIT"
] | 2 | 2019-03-31T00:28:17.000Z | 2021-03-17T16:13:30.000Z | from django.conf import settings
from django.db import models
class Cart(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
| 18.375 | 55 | 0.789116 | from django.conf import settings
from django.db import models
class Cart(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
| true | true |
f7367b513652b4c598452dcba5f0e55aea742d5d | 630 | py | Python | p2p_python/serializer.py | namuyan/p2p-python | d67982f10d7e2506fbdacce933ce8ce3c8771909 | [
"MIT"
] | 63 | 2018-02-06T08:04:35.000Z | 2022-01-07T15:09:23.000Z | p2p_python/serializer.py | namuyan/p2p-python | d67982f10d7e2506fbdacce933ce8ce3c8771909 | [
"MIT"
] | 4 | 2018-04-30T14:42:33.000Z | 2020-07-20T05:40:50.000Z | p2p_python/serializer.py | namuyan/p2p-python | d67982f10d7e2506fbdacce933ce8ce3c8771909 | [
"MIT"
] | 13 | 2018-08-23T09:11:41.000Z | 2022-02-24T17:29:16.000Z | import msgpack
def dump(obj, fp, default=None):
msgpack.pack(obj, fp, use_bin_type=True, default=default)
def dumps(obj, default=None):
return msgpack.packb(obj, use_bin_type=True, default=default)
def load(fp, object_hook=None):
return msgpack.unpack(fp, object_hook=object_hook, encoding='utf8')
de... | 20.322581 | 73 | 0.706349 | import msgpack
def dump(obj, fp, default=None):
msgpack.pack(obj, fp, use_bin_type=True, default=default)
def dumps(obj, default=None):
return msgpack.packb(obj, use_bin_type=True, default=default)
def load(fp, object_hook=None):
return msgpack.unpack(fp, object_hook=object_hook, encoding='utf8')
de... | true | true |
f7367b85ef33529c5c360e68d214cb8e6a80a38f | 4,752 | py | Python | dist/Platform.app/Contents/Resources/lib/python3.7/wx/lib/colourchooser/canvas.py | njalloul90/Genomics_Oncology_Platform | 9bf6d0edca5df783f4e371fa1bc46b7b1576fe70 | [
"MIT"
] | 6 | 2021-07-26T14:21:25.000Z | 2021-07-26T14:32:01.000Z | dist/Platform.app/Contents/Resources/lib/python3.7/wx/lib/colourchooser/canvas.py | njalloul90/Genomics_Oncology_Platform | 9bf6d0edca5df783f4e371fa1bc46b7b1576fe70 | [
"MIT"
] | 9 | 2021-03-18T23:10:27.000Z | 2022-03-11T23:43:55.000Z | dist/Platform.app/Contents/Resources/lib/python3.7/wx/lib/colourchooser/canvas.py | njalloul90/Genomics_Oncology_Platform | 9bf6d0edca5df783f4e371fa1bc46b7b1576fe70 | [
"MIT"
] | 2 | 2019-03-11T05:06:49.000Z | 2019-03-22T21:48:49.000Z | """
PyColourChooser
Copyright (C) 2002 Michael Gilfix <mgilfix@eecs.tufts.edu>
This file is part of PyColourChooser.
This version of PyColourChooser is open source; you can redistribute it
and/or modify it under the licensed terms.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRA... | 32.547945 | 71 | 0.643729 |
import wx
class BitmapBuffer(wx.MemoryDC):
def __init__(self, width, height, colour):
wx.MemoryDC.__init__(self)
self.width = width
self.height = height
self.colour = colour
self.bitmap = wx.Bitmap(self.width, self.height)
self.SelectObject(self.bitmap... | true | true |
f7367bf515d1485d5cfca2aca9bb5f63d46f501e | 1,013 | py | Python | input.py | aragaer/pa-client | a2d2cc0300e931aecf1fe86f3a34b05b427c5fa3 | [
"MIT"
] | null | null | null | input.py | aragaer/pa-client | a2d2cc0300e931aecf1fe86f3a34b05b427c5fa3 | [
"MIT"
] | null | null | null | input.py | aragaer/pa-client | a2d2cc0300e931aecf1fe86f3a34b05b427c5fa3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import subprocess
def naive_config_read(cfg):
for line in cfg:
key, val = line.strip().split(':')
if key == 'pipe':
return val.strip()
else:
print("Input pipe not found in config")
exit(0)
def main(config_file):
... | 24.119048 | 63 | 0.591313 |
import argparse
import os
import subprocess
def naive_config_read(cfg):
for line in cfg:
key, val = line.strip().split(':')
if key == 'pipe':
return val.strip()
else:
print("Input pipe not found in config")
exit(0)
def main(config_file):
if not os.path.exists... | true | true |
f7367c74e0c12e658709e53a56ee8a06dbd8413b | 10,204 | py | Python | cogs/extras.py | HeyItsIconic/Kurisu | 4e203bc17a55bd0bd087f9e1ce0b891da8bfa916 | [
"Apache-2.0"
] | null | null | null | cogs/extras.py | HeyItsIconic/Kurisu | 4e203bc17a55bd0bd087f9e1ce0b891da8bfa916 | [
"Apache-2.0"
] | null | null | null | cogs/extras.py | HeyItsIconic/Kurisu | 4e203bc17a55bd0bd087f9e1ce0b891da8bfa916 | [
"Apache-2.0"
] | null | null | null | import datetime
import discord
import os
import random
import re
import string
from utils.checks import is_staff
from discord.ext import commands
from discord import TextChannel
class Extras(commands.Cog):
"""
Extra things.
"""
def __init__(self, bot):
self.bot = bot
self.nick_pattern... | 41.819672 | 202 | 0.609369 | import datetime
import discord
import os
import random
import re
import string
from utils.checks import is_staff
from discord.ext import commands
from discord import TextChannel
class Extras(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.nick_pattern = re.compile("^[a-z]{2,}.*$", re.... | true | true |
f7367caedc1d4edd7e13f64309d55eeb44425b99 | 92,901 | py | Python | scripts/parameter_validation_generator.py | ziga-lunarg/Vulkan-ValidationLayers | d23bc291bad0f606515d368e51018a5cb30e2ba9 | [
"Apache-2.0"
] | null | null | null | scripts/parameter_validation_generator.py | ziga-lunarg/Vulkan-ValidationLayers | d23bc291bad0f606515d368e51018a5cb30e2ba9 | [
"Apache-2.0"
] | null | null | null | scripts/parameter_validation_generator.py | ziga-lunarg/Vulkan-ValidationLayers | d23bc291bad0f606515d368e51018a5cb30e2ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3 -i
#
# Copyright (c) 2015-2021 The Khronos Group Inc.
# Copyright (c) 2015-2021 Valve Corporation
# Copyright (c) 2015-2021 LunarG, Inc.
# Copyright (c) 2015-2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 58.686671 | 300 | 0.582674 |
import os,re,sys,string,json
import xml.etree.ElementTree as etree
from generator import *
from collections import namedtuple
from common_codegen import *
def multi_string_iter(lines):
for i, ul in enumerate(lines):
if not isinstance(ul, list):
def setter(x): lines[i... | true | true |
f7367d3e91a11abf0fcf39706c137ba09ea539be | 921 | py | Python | back/popo/__init__.py | supercilium/popoeshnick | 4f2111e7841fbbb5b43a61b2e9011ccac192b12f | [
"MIT"
] | null | null | null | back/popo/__init__.py | supercilium/popoeshnick | 4f2111e7841fbbb5b43a61b2e9011ccac192b12f | [
"MIT"
] | 8 | 2019-03-14T15:48:49.000Z | 2020-08-30T16:30:52.000Z | back/popo/__init__.py | supercilium/popoeshnick | 4f2111e7841fbbb5b43a61b2e9011ccac192b12f | [
"MIT"
] | 1 | 2020-07-04T06:33:29.000Z | 2020-07-04T06:33:29.000Z | from flask import Flask
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_session import Session
from datetime import timedelta
app = Flask(__name__)
###################### for testing #########################
@app.route('/')
def hello_world():
... | 19.595745 | 68 | 0.703583 | from flask import Flask
from flask_restful import Api
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_session import Session
from datetime import timedelta
app = Flask(__name__)
| true | true |
f7367ec0b1c08ca138247592c249252349d7aef0 | 12,392 | py | Python | src/preprocessing/02_extractlogtraces/03_join_responses_with_ip.py | wikimedia/research-reader-survey-analysis | fbf4d71eebaf5ac5205713b0271f4ea51ab388f8 | [
"MIT"
] | null | null | null | src/preprocessing/02_extractlogtraces/03_join_responses_with_ip.py | wikimedia/research-reader-survey-analysis | fbf4d71eebaf5ac5205713b0271f4ea51ab388f8 | [
"MIT"
] | null | null | null | src/preprocessing/02_extractlogtraces/03_join_responses_with_ip.py | wikimedia/research-reader-survey-analysis | fbf4d71eebaf5ac5205713b0271f4ea51ab388f8 | [
"MIT"
] | null | null | null | """
This script joins:
* the EventLogging (EL) data based on webrequest beacons (in my experience, most complete / simplest)
* Google Forms survey responses
* EditAttemptStep data based on hive tables
There are two outputs for each language:
* CSV w/ survey responses + EL details (e.g., datetime, pageID) + webrequ... | 44.736462 | 118 | 0.577873 |
import argparse
import csv
import os
from geopy.distance import distance
import pandas as pd
import sys
sys.path.append(os.path.abspath(os.path.abspath(os.path.dirname(__file__)) + '/../../..'))
from src.utils import config
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--el_logs_fn"... | true | true |
f7367fbd890732a0926b6aa0105cd9b4bbca9b3f | 4,326 | py | Python | contrib/seeds/generate-seeds.py | Satoshi-Nosamoto/NOS-Coin | e542087d45e53640f2f608553c2377b95a3095e6 | [
"MIT"
] | 1 | 2018-05-29T12:49:19.000Z | 2018-05-29T12:49:19.000Z | contrib/seeds/generate-seeds.py | Satoshi-Nosamoto/NOS-Coin | e542087d45e53640f2f608553c2377b95a3095e6 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | Satoshi-Nosamoto/NOS-Coin | e542087d45e53640f2f608553c2377b95a3095e6 | [
"MIT"
] | 5 | 2018-05-28T12:19:00.000Z | 2018-09-26T14:16:52.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.347826 | 98 | 0.581368 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:... | true | true |
f7368159615fc34ed4019158803029ce0739af7b | 3,493 | py | Python | sdk/core/azure-core/tests/azure_core_asynctests/test_stream_generator.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/core/azure-core/tests/azure_core_asynctests/test_stream_generator.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/core/azure-core/tests/azure_core_asynctests/test_stream_generator.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from azure.core.pipeline.transport import (
HttpRequest,
AsyncHttpResponse,
AsyncHttpTransport,
)
from azure.core.pipeline import AsyncPipeline
from azure.co... | 32.342593 | 81 | 0.621815 |
from azure.core.pipeline.transport import (
HttpRequest,
AsyncHttpResponse,
AsyncHttpTransport,
)
from azure.core.pipeline import AsyncPipeline
from azure.core.pipeline.transport._aiohttp import AioHttpStreamDownloadGenerator
from unittest import mock
import pytest
@pytest.mark.asyncio
async def test_c... | true | true |
f73681c2212c77dcbc3c9aa8cf6c020c06b27702 | 223 | py | Python | app/api/business/buyer_dashboard_business.py | ArenaNetworks/dto-digitalmarketplace-api | d0d58924719d889503ed112b0d5801b528b0398c | [
"MIT"
] | 6 | 2017-06-09T03:38:53.000Z | 2021-12-22T02:42:15.000Z | app/api/business/buyer_dashboard_business.py | ArenaNetworks/dto-digitalmarketplace-api | d0d58924719d889503ed112b0d5801b528b0398c | [
"MIT"
] | 47 | 2016-08-02T05:21:31.000Z | 2022-03-28T01:14:17.000Z | app/api/business/buyer_dashboard_business.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 7 | 2016-09-13T13:07:18.000Z | 2021-02-17T10:16:21.000Z | from app.api.services import (
briefs
)
def get_briefs(user_id, status=None):
return briefs.get_buyer_dashboard_briefs(user_id, status)
def get_brief_counts(user_id):
return briefs.get_brief_counts(user_id)
| 18.583333 | 61 | 0.7713 | from app.api.services import (
briefs
)
def get_briefs(user_id, status=None):
return briefs.get_buyer_dashboard_briefs(user_id, status)
def get_brief_counts(user_id):
return briefs.get_brief_counts(user_id)
| true | true |
f73682241a967aacbd505aac5535efe0276e9f2d | 2,167 | py | Python | doit/cmd_forget.py | samuelsinayoko/doit | e7aa4f5f399c65bf9567ced9fb2673d52d9d6c92 | [
"MIT"
] | 1,390 | 2015-01-01T21:11:47.000Z | 2022-03-31T11:35:44.000Z | doit/cmd_forget.py | samuelsinayoko/doit | e7aa4f5f399c65bf9567ced9fb2673d52d9d6c92 | [
"MIT"
] | 393 | 2015-01-05T11:18:29.000Z | 2022-03-20T11:46:46.000Z | doit/cmd_forget.py | samuelsinayoko/doit | e7aa4f5f399c65bf9567ced9fb2673d52d9d6c92 | [
"MIT"
] | 176 | 2015-01-07T16:58:56.000Z | 2022-03-28T12:12:11.000Z | from .cmd_base import DoitCmdBase, check_tasks_exist
from .cmd_base import tasks_and_deps_iter, subtasks_iter
opt_forget_taskdep = {
'name': 'forget_sub',
'short': 's',
'long': 'follow-sub',
'type': bool,
'default': False,
'help': 'forget task dependencies too',
}
opt_disable_default = {
... | 30.097222 | 83 | 0.599908 | from .cmd_base import DoitCmdBase, check_tasks_exist
from .cmd_base import tasks_and_deps_iter, subtasks_iter
opt_forget_taskdep = {
'name': 'forget_sub',
'short': 's',
'long': 'follow-sub',
'type': bool,
'default': False,
'help': 'forget task dependencies too',
}
opt_disable_default = {
... | true | true |
f7368282604de6c7f380a341ed708f7699454f4f | 2,767 | py | Python | gain/cumulative_gain_planted_forest.py | elizabethgoldman/carbon-budget | e224467f554c603704ef31d8e42a99db8bd160a7 | [
"Apache-2.0"
] | null | null | null | gain/cumulative_gain_planted_forest.py | elizabethgoldman/carbon-budget | e224467f554c603704ef31d8e42a99db8bd160a7 | [
"Apache-2.0"
] | null | null | null | gain/cumulative_gain_planted_forest.py | elizabethgoldman/carbon-budget | e224467f554c603704ef31d8e42a99db8bd160a7 | [
"Apache-2.0"
] | null | null | null | ### This script calculates the cumulative above and belowground carbon gain in non-mangrove planted forest pixels from 2001-2015.
### It multiplies the annual biomass gain rate by the number of years of gain by the biomass-to-carbon conversion.
import datetime
import subprocess
import sys
sys.path.append('../')
import... | 51.240741 | 162 | 0.76798 | orest_non_mangrove)
accum_calc = '--calc=A*B*{}'.format(cn.biomass_to_c_natrl_forest)
AGC_accum_outfilename = '{0}_{1}.tif'.format(tile_id, cn.pattern_cumul_gain_AGC_planted_forest_non_mangrove)
AGC_accum_outfilearg = '--outfile={}'.format(AGC_accum_outfilename)
cmd = ['gdal_calc.py', '-A', gain_r... | false | true |
f736843c3e9a412e98dcc760a9f33e7f532cd580 | 5,462 | py | Python | scraper.py | Mastermind497/DogDataFinder | 6192db5c7556c4fa1d593725a1d5b4dc0bb26c58 | [
"MIT"
] | 1 | 2021-01-11T14:07:14.000Z | 2021-01-11T14:07:14.000Z | scraper.py | Mastermind497/DogDataFinder | 6192db5c7556c4fa1d593725a1d5b4dc0bb26c58 | [
"MIT"
] | null | null | null | scraper.py | Mastermind497/DogDataFinder | 6192db5c7556c4fa1d593725a1d5b4dc0bb26c58 | [
"MIT"
] | null | null | null | import requests
import urllib.request
import time
import xlwt
from bs4 import BeautifulSoup
def addHeadersToSheet(worksheet):
#Add Style for the Headers
style_text_wrap_font_bold_black_color = xlwt.easyxf('align:wrap on; font: bold on, color-index black')
col_width = 128*30
worksheet.write(0, 0, "BREED... | 38.464789 | 142 | 0.685646 | import requests
import urllib.request
import time
import xlwt
from bs4 import BeautifulSoup
def addHeadersToSheet(worksheet):
style_text_wrap_font_bold_black_color = xlwt.easyxf('align:wrap on; font: bold on, color-index black')
col_width = 128*30
worksheet.write(0, 0, "BREED", style_text_wrap_font_bo... | true | true |
f7368465fe7af359a0e682f88039ce381df409ff | 2,676 | py | Python | algos/prediction/transformers.py | gcba/IATos | d42cffea313170bb249edcadb0776f7a6d368654 | [
"MIT"
] | 3 | 2022-01-21T02:50:16.000Z | 2022-02-22T13:00:00.000Z | algos/prediction/transformers.py | gcba/IATos | d42cffea313170bb249edcadb0776f7a6d368654 | [
"MIT"
] | null | null | null | algos/prediction/transformers.py | gcba/IATos | d42cffea313170bb249edcadb0776f7a6d368654 | [
"MIT"
] | 2 | 2021-09-07T03:19:35.000Z | 2021-09-08T13:37:48.000Z | import librosa
import numpy as np
from PIL import Image
from typing import Optional
from sklearn.base import BaseEstimator, TransformerMixin
from matplotlib.cm import ScalarMappable
__all__ = [
"Denoising",
"MelSpectogram",
"ColoredSpectogram",
]
class BaseTransformer(BaseEstimator, TransformerMixin):
... | 24.550459 | 89 | 0.611734 | import librosa
import numpy as np
from PIL import Image
from typing import Optional
from sklearn.base import BaseEstimator, TransformerMixin
from matplotlib.cm import ScalarMappable
__all__ = [
"Denoising",
"MelSpectogram",
"ColoredSpectogram",
]
class BaseTransformer(BaseEstimator, TransformerMixin):
... | true | true |
f73684fe31a19ed4f0c1ff760d55d461573b2eae | 6,024 | py | Python | test/client/test_request_upload.py | sgnes/python-udsoncan | 0906911a50e8e4e64feaf4d29c0ac884ec0df61d | [
"MIT"
] | 1 | 2019-07-02T10:15:03.000Z | 2019-07-02T10:15:03.000Z | test/client/test_request_upload.py | sgnes/python-udsoncan | 0906911a50e8e4e64feaf4d29c0ac884ec0df61d | [
"MIT"
] | null | null | null | test/client/test_request_upload.py | sgnes/python-udsoncan | 0906911a50e8e4e64feaf4d29c0ac884ec0df61d | [
"MIT"
] | null | null | null | from udsoncan.client import Client
from udsoncan import services, MemoryLocation, DataFormatIdentifier
from udsoncan.exceptions import *
from test.ClientServerTest import ClientServerTest
class TestRequestUpload(ClientServerTest):
def __init__(self, *args, **kwargs):
ClientServerTest.__init__(self, *args, **kwargs... | 48.192 | 99 | 0.813413 | from udsoncan.client import Client
from udsoncan import services, MemoryLocation, DataFormatIdentifier
from udsoncan.exceptions import *
from test.ClientServerTest import ClientServerTest
class TestRequestUpload(ClientServerTest):
def __init__(self, *args, **kwargs):
ClientServerTest.__init__(self, *args, **kwargs... | true | true |
f736852b4871bb5c2d35bf29484950631a1b5694 | 1,098 | py | Python | solution/143. reorder-list.py | sundaycat/Leetcode-Practice | 65c3ab0f967331a095fd8a6eb2f3d7765cbf7d5a | [
"MIT"
] | null | null | null | solution/143. reorder-list.py | sundaycat/Leetcode-Practice | 65c3ab0f967331a095fd8a6eb2f3d7765cbf7d5a | [
"MIT"
] | null | null | null | solution/143. reorder-list.py | sundaycat/Leetcode-Practice | 65c3ab0f967331a095fd8a6eb2f3d7765cbf7d5a | [
"MIT"
] | null | null | null | from LinkedList import *
class Solution(LinkedList):
def reverse(self, head):
pre = None
while head:
next = head.next
head.next = pre
pre = head
head = next
return pre
def reorderList(self, head: ListNode) -> None:
... | 23.361702 | 50 | 0.510929 | from LinkedList import *
class Solution(LinkedList):
def reverse(self, head):
pre = None
while head:
next = head.next
head.next = pre
pre = head
head = next
return pre
def reorderList(self, head: ListNode) -> None:
... | true | true |
f73686f1dffadac2a4e983ba72a126c53b2ed4b4 | 305 | py | Python | HttpMessageParser/http1/utils/FileUtil.py | Patr1ck97/HttpMessageParser | 3cc22679744a68b4cea1d701b834480b1d96fb04 | [
"Apache-2.0"
] | null | null | null | HttpMessageParser/http1/utils/FileUtil.py | Patr1ck97/HttpMessageParser | 3cc22679744a68b4cea1d701b834480b1d96fb04 | [
"Apache-2.0"
] | null | null | null | HttpMessageParser/http1/utils/FileUtil.py | Patr1ck97/HttpMessageParser | 3cc22679744a68b4cea1d701b834480b1d96fb04 | [
"Apache-2.0"
] | null | null | null | import json
class FileUtil:
@classmethod
def read_as_dict(cls, file) -> dict:
string = cls.read_as_str(file)
return json.loads(string)
@classmethod
def read_as_str(cls, file) -> str:
with open(file, mode="r", encoding="utf-8") as f:
return f.read()
| 20.333333 | 57 | 0.6 | import json
class FileUtil:
@classmethod
def read_as_dict(cls, file) -> dict:
string = cls.read_as_str(file)
return json.loads(string)
@classmethod
def read_as_str(cls, file) -> str:
with open(file, mode="r", encoding="utf-8") as f:
return f.read()
| true | true |
f73687942aaf768e1eb3db6df96f377f6b399bab | 59 | py | Python | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/M/muon-proton mag. mom. ratio.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/M/muon-proton mag. mom. ratio.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/M/muon-proton mag. mom. ratio.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | constants.physical_constants["muon-proton mag. mom. ratio"] | 59 | 59 | 0.813559 | constants.physical_constants["muon-proton mag. mom. ratio"] | true | true |
f73687b79dcf99809b548c00bc6d3a21444a082c | 35,850 | py | Python | python/ccxt/async_support/huobipro.py | vankiaio/ccxt | 44f69b681c2772c5f585db6d55c5d10cb6d64017 | [
"MIT"
] | 1 | 2018-12-11T12:42:34.000Z | 2018-12-11T12:42:34.000Z | python/ccxt/async_support/huobipro.py | vankiaio/ccxt | 44f69b681c2772c5f585db6d55c5d10cb6d64017 | [
"MIT"
] | null | null | null | python/ccxt/async_support/huobipro.py | vankiaio/ccxt | 44f69b681c2772c5f585db6d55c5d10cb6d64017 | [
"MIT"
] | 1 | 2022-03-15T22:41:20.000Z | 2022-03-15T22:41:20.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 42.226148 | 355 | 0.501199 |
rt.base.exchange import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrde... | true | true |
f73687d75ddedbad5f641cebbaab293e9fc2d28b | 7,393 | py | Python | mxts/strategy/utils.py | kevingivens/mxts | e0a9810ae7e696ffa537019a1ae2582495b40473 | [
"Apache-2.0"
] | null | null | null | mxts/strategy/utils.py | kevingivens/mxts | e0a9810ae7e696ffa537019a1ae2582495b40473 | [
"Apache-2.0"
] | null | null | null | mxts/strategy/utils.py | kevingivens/mxts | e0a9810ae7e696ffa537019a1ae2582495b40473 | [
"Apache-2.0"
] | null | null | null | import asyncio
from datetime import datetime
from typing import Union, Callable, Optional, List, TYPE_CHECKING
from ..config import Side, TradingType, ExitRoutine, InstrumentType
from ..core import Trade, Instrument, ExchangeType, Order, OrderBook
from ..exchange import Exchange
from ..engine.managers import Periodic
... | 36.418719 | 106 | 0.608008 | import asyncio
from datetime import datetime
from typing import Union, Callable, Optional, List, TYPE_CHECKING
from ..config import Side, TradingType, ExitRoutine, InstrumentType
from ..core import Trade, Instrument, ExchangeType, Order, OrderBook
from ..exchange import Exchange
from ..engine.managers import Periodic
... | true | true |
f73689676c7e34072751132b67e88ebf427c1287 | 842 | py | Python | setup.py | yupingso/randomproto | a36c0e13be893d9fd3a63e3390fc11fc0de250b9 | [
"MIT"
] | 6 | 2019-03-25T03:45:43.000Z | 2019-07-03T06:31:31.000Z | setup.py | yupingso/randomproto | a36c0e13be893d9fd3a63e3390fc11fc0de250b9 | [
"MIT"
] | 1 | 2019-06-03T09:13:44.000Z | 2019-06-03T09:13:44.000Z | setup.py | yupingso/randomproto | a36c0e13be893d9fd3a63e3390fc11fc0de250b9 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name='randomproto',
version='0.0.1',
py_modules=('randomproto',),
install_requires=[
'protobuf>=3.6.0',
],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest==4.2.1',
'pytest-cov==2.6.1',
'pytest-mock... | 26.3125 | 64 | 0.608076 | import setuptools
setuptools.setup(
name='randomproto',
version='0.0.1',
py_modules=('randomproto',),
install_requires=[
'protobuf>=3.6.0',
],
setup_requires=[
'pytest-runner',
],
tests_require=[
'pytest==4.2.1',
'pytest-cov==2.6.1',
'pytest-mock... | true | true |
f7368a1ac02d29ee3a35858f88c6ce9c101d00b8 | 993 | py | Python | lib/pycoin/pycoin/tx/pay_to/ScriptNulldata.py | AYCHDO/Dominus | d7065816febafb6cf0fb1142ff7dc7e454c835ad | [
"MIT"
] | 68 | 2015-08-30T13:23:12.000Z | 2022-02-26T06:59:15.000Z | lib/pycoin/pycoin/tx/pay_to/ScriptNulldata.py | AYCHDO/Dominus | d7065816febafb6cf0fb1142ff7dc7e454c835ad | [
"MIT"
] | 44 | 2016-02-14T02:08:00.000Z | 2020-11-11T09:03:55.000Z | lib/pycoin/pycoin/tx/pay_to/ScriptNulldata.py | AYCHDO/Dominus | d7065816febafb6cf0fb1142ff7dc7e454c835ad | [
"MIT"
] | 56 | 2015-08-26T12:49:20.000Z | 2022-02-17T19:06:36.000Z | from ..script import tools
from ...serialize import b2h
from .ScriptType import ScriptType
class ScriptNulldata(ScriptType):
TEMPLATE = tools.compile("OP_RETURN OP_NULLDATA")
def __init__(self, nulldata):
self.nulldata = nulldata
self._script = None
@classmethod
def from_script(cls... | 26.837838 | 80 | 0.621349 | from ..script import tools
from ...serialize import b2h
from .ScriptType import ScriptType
class ScriptNulldata(ScriptType):
TEMPLATE = tools.compile("OP_RETURN OP_NULLDATA")
def __init__(self, nulldata):
self.nulldata = nulldata
self._script = None
@classmethod
def from_script(cls... | true | true |
f7368ab478d23ff790912d01221ac59d2a174d83 | 799 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLES2/OVR/multiview_multisampled_render_to_texture.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLES2/OVR/multiview_multisampled_render_to_texture.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GLES2/OVR/multiview_multisampled_render_to_texture.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
... | 44.388889 | 148 | 0.809762 | from OpenGL import platform as _p, arrays
from OpenGL.raw.GLES2 import _types as _cs
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GLES2_OVR_multiview_multisampled_render_to_texture'
def _f( function ):
... | true | true |
f7368ae3c387c509bf7bb279b519d759d46d4dc4 | 1,059 | py | Python | parse_html.py | BeyondHeaven/parse_html | 5b59549de73f461706bb4bad9ebb989fe66adc8f | [
"MIT"
] | null | null | null | parse_html.py | BeyondHeaven/parse_html | 5b59549de73f461706bb4bad9ebb989fe66adc8f | [
"MIT"
] | null | null | null | parse_html.py | BeyondHeaven/parse_html | 5b59549de73f461706bb4bad9ebb989fe66adc8f | [
"MIT"
] | null | null | null | import argparse
import requests
import time
import random
def get_arguments():
parser = argparse.ArgumentParser(description="path")
parser.add_argument("--url-file", type=str, default='',
help="url file path",
required=True)
parser.add_argument("--output-dir"... | 28.621622 | 117 | 0.582625 | import argparse
import requests
import time
import random
def get_arguments():
parser = argparse.ArgumentParser(description="path")
parser.add_argument("--url-file", type=str, default='',
help="url file path",
required=True)
parser.add_argument("--output-dir"... | true | true |
f7368b970bb59efe26b74439b895d7e2efff05cb | 4,118 | py | Python | api/routers/odin.py | KAIYO-OSS/titan | 0a4e296ded466785334279f7106d390c1dd4c30b | [
"Apache-2.0"
] | 55 | 2021-01-27T18:39:39.000Z | 2022-03-16T10:56:46.000Z | api/routers/odin.py | KAIYO-OSS/titan | 0a4e296ded466785334279f7106d390c1dd4c30b | [
"Apache-2.0"
] | 17 | 2021-06-05T12:28:35.000Z | 2022-02-14T13:11:26.000Z | api/routers/odin.py | KAIYO-OSS/titan | 0a4e296ded466785334279f7106d390c1dd4c30b | [
"Apache-2.0"
] | null | null | null | import json
from fastapi import APIRouter, HTTPException
from util.helm import Helm
from models.deployRequest import DeployRequest
from models.rollbackRequest import RollbackRequest
from util.utilityHelpers import Utils
from util.kubernetes import Kubernentes
import etcd3
router = APIRouter()
etcd = etcd3.client()
... | 32.68254 | 100 | 0.607576 | import json
from fastapi import APIRouter, HTTPException
from util.helm import Helm
from models.deployRequest import DeployRequest
from models.rollbackRequest import RollbackRequest
from util.utilityHelpers import Utils
from util.kubernetes import Kubernentes
import etcd3
router = APIRouter()
etcd = etcd3.client()
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.