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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c29bc1590cfa93464c4a08c0a9c7fdd22699ce4 | 832 | py | Python | setup.py | kapsali29/StackStatsAPI | 5181bd5275129080206350e147ce6b1db18a0b69 | [
"MIT"
] | null | null | null | setup.py | kapsali29/StackStatsAPI | 5181bd5275129080206350e147ce6b1db18a0b69 | [
"MIT"
] | null | null | null | setup.py | kapsali29/StackStatsAPI | 5181bd5275129080206350e147ce6b1db18a0b69 | [
"MIT"
] | null | null | null | from setuptools import setup
requirements = [
'beautifulsoup4==4.7.1',
'bs4==0.0.1',
'certifi==2018.11.29',
'chardet==3.0.4',
'idna==2.8',
'json2html==1.2.1',
'nose==1.3.7',
'python-dateutil==2.7.5',
'requests==2.21.0',
'six==1.12.0',
'soupsieve==1.7.1',
'tabulate==0.8.2... | 23.771429 | 68 | 0.575721 | from setuptools import setup
requirements = [
'beautifulsoup4==4.7.1',
'bs4==0.0.1',
'certifi==2018.11.29',
'chardet==3.0.4',
'idna==2.8',
'json2html==1.2.1',
'nose==1.3.7',
'python-dateutil==2.7.5',
'requests==2.21.0',
'six==1.12.0',
'soupsieve==1.7.1',
'tabulate==0.8.2... | true | true |
1c29bc53bb502121756fdebae63f7649a32fe3d7 | 1,899 | py | Python | scripts/add_site_ids.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 13 | 2016-01-14T02:43:10.000Z | 2020-11-25T20:43:05.000Z | scripts/add_site_ids.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 84 | 2015-11-20T02:03:33.000Z | 2021-10-14T19:24:24.000Z | scripts/add_site_ids.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 5 | 2015-11-25T19:29:53.000Z | 2019-09-04T17:37:52.000Z | #
# Copyright 2015-2019, Institute for Systems Biology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 34.527273 | 167 | 0.707741 |
from __future__ import print_function
import os
import MySQLdb
import logging
import traceback
import sys
from isb_cgc import secret_settings
logging.basicConfig(level=logging.INFO)
db = None
cursor = None
try:
db_settings = secret_settings.get('DATABASE')['default']
ssl = None
if 'OPTIO... | true | true |
1c29bc8fc87e7fa37b1a012a0b58c2f4d77122ff | 827 | py | Python | src/tests/common/forms/test_cfp_forms_utils.py | xhub/pretalx | 33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e | [
"Apache-2.0"
] | null | null | null | src/tests/common/forms/test_cfp_forms_utils.py | xhub/pretalx | 33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e | [
"Apache-2.0"
] | 1 | 2019-07-05T20:03:42.000Z | 2019-07-05T20:03:42.000Z | src/tests/common/forms/test_cfp_forms_utils.py | xhub/pretalx | 33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e | [
"Apache-2.0"
] | null | null | null | import pytest
from pretalx.common.forms.utils import get_help_text
@pytest.mark.parametrize('text,min_length,max_length,_type,warning', (
('t', 1, 3, 'chars', 't Please write between 1 and 3 characters.'),
('', 1, 3, 'chars', 'Please write between 1 and 3 characters.'),
('t', 0, 3, 'chars', 't Please wri... | 45.944444 | 81 | 0.644498 | import pytest
from pretalx.common.forms.utils import get_help_text
@pytest.mark.parametrize('text,min_length,max_length,_type,warning', (
('t', 1, 3, 'chars', 't Please write between 1 and 3 characters.'),
('', 1, 3, 'chars', 'Please write between 1 and 3 characters.'),
('t', 0, 3, 'chars', 't Please wri... | true | true |
1c29bcf8c8760602be645b62d0a63ad3ed652a8b | 18,936 | py | Python | app/api/features.py | ldesousa/ogcldapi | e2fa386933b3003181c48b628e7f8daf1d0a2120 | [
"Apache-2.0"
] | 1 | 2022-01-23T14:29:40.000Z | 2022-01-23T14:29:40.000Z | app/api/features.py | ldesousa/ogcldapi | e2fa386933b3003181c48b628e7f8daf1d0a2120 | [
"Apache-2.0"
] | 4 | 2021-11-05T18:16:43.000Z | 2021-11-26T01:59:47.000Z | app/api/features.py | ldesousa/ogcldapi | e2fa386933b3003181c48b628e7f8daf1d0a2120 | [
"Apache-2.0"
] | 1 | 2021-11-08T22:36:52.000Z | 2021-11-08T22:36:52.000Z | import re
from typing import List
from SPARQLWrapper import SPARQLWrapper, JSON
from fastapi import Response
from fastapi.responses import JSONResponse
from fastapi.templating import Jinja2Templates
from pyldapi import ContainerRenderer, RDF_MEDIATYPES
from rdflib import Graph, Literal, URIRef
from rdflib.namespace im... | 36.768932 | 118 | 0.521493 | import re
from typing import List
from SPARQLWrapper import SPARQLWrapper, JSON
from fastapi import Response
from fastapi.responses import JSONResponse
from fastapi.templating import Jinja2Templates
from pyldapi import ContainerRenderer, RDF_MEDIATYPES
from rdflib import Graph, Literal, URIRef
from rdflib.namespace im... | true | true |
1c29bd4b593ed5639ea563cb6bdac3d6e6b33791 | 2,491 | py | Python | ravenframework/CodeInterfaces.py | khurrumsaleem/raven | 3a158f9ae3851d3eca51b4bd91ea6494e5c0ed89 | [
"Apache-2.0"
] | null | null | null | ravenframework/CodeInterfaces.py | khurrumsaleem/raven | 3a158f9ae3851d3eca51b4bd91ea6494e5c0ed89 | [
"Apache-2.0"
] | null | null | null | ravenframework/CodeInterfaces.py | khurrumsaleem/raven | 3a158f9ae3851d3eca51b4bd91ea6494e5c0ed89 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 46.12963 | 101 | 0.62786 |
from __future__ import division, print_function, unicode_literals, absolute_import
import os
from glob import glob
import inspect
from .EntityFactoryBase import EntityFactory
from .utils import utils
__moduleInterfaceList = []
startDir = os.path.join(os.path.dirname(__file__),'CodeInterfaces')
for... | true | true |
1c29bd57b94ab4877591158ce98b83bac52dc757 | 527 | py | Python | leetcode/0168 Excel Sheet Column Title.py | jaredliw/python-question-bank | 9c8c246623d8d171f875700b57772df0afcbdcdf | [
"MIT"
] | 1 | 2021-04-08T07:49:15.000Z | 2021-04-08T07:49:15.000Z | leetcode/0168 Excel Sheet Column Title.py | jaredliw/leetcode-solutions | 9c8c246623d8d171f875700b57772df0afcbdcdf | [
"MIT"
] | null | null | null | leetcode/0168 Excel Sheet Column Title.py | jaredliw/leetcode-solutions | 9c8c246623d8d171f875700b57772df0afcbdcdf | [
"MIT"
] | 1 | 2022-01-23T02:12:24.000Z | 2022-01-23T02:12:24.000Z | class Solution(object):
def convertToTitle(self, columnNumber):
"""
:type columnNumber: int
:rtype: str
"""
# Runtime: 20 ms
# Memory: 13.3 MB
colname = ""
while True:
columnNumber, mod = divmod(columnNumber, 26)
if mod == 0:
... | 26.35 | 56 | 0.440228 | class Solution(object):
def convertToTitle(self, columnNumber):
colname = ""
while True:
columnNumber, mod = divmod(columnNumber, 26)
if mod == 0:
colname += "Z"
columnNumber -= 1
else:
colname += c... | true | true |
1c29bd6eb0865b6126533f8866730494df975538 | 4,633 | py | Python | src/openeo_grass_gis_driver/actinia_processing/reduce_time_process.py | marcjansen/openeo-grassgis-driver | 57b309819fdc456fba02cd1ab8fe6731ddfbb66a | [
"Apache-2.0"
] | 7 | 2018-03-16T17:26:14.000Z | 2022-03-09T08:19:10.000Z | src/openeo_grass_gis_driver/actinia_processing/reduce_time_process.py | marcjansen/openeo-grassgis-driver | 57b309819fdc456fba02cd1ab8fe6731ddfbb66a | [
"Apache-2.0"
] | 70 | 2018-03-09T11:28:12.000Z | 2022-02-17T09:06:17.000Z | src/openeo_grass_gis_driver/actinia_processing/reduce_time_process.py | marcjansen/openeo-grassgis-driver | 57b309819fdc456fba02cd1ab8fe6731ddfbb66a | [
"Apache-2.0"
] | 13 | 2018-03-12T09:58:24.000Z | 2022-02-23T10:40:11.000Z | # -*- coding: utf-8 -*-
from random import randint
import json
from openeo_grass_gis_driver.models.process_graph_schemas import \
ProcessGraphNode, ProcessGraph
from openeo_grass_gis_driver.actinia_processing.base import \
Node, check_node_parents, DataObject, GrassDataType, \
create_output_name
from op... | 30.682119 | 92 | 0.641917 |
from random import randint
import json
from openeo_grass_gis_driver.models.process_graph_schemas import \
ProcessGraphNode, ProcessGraph
from openeo_grass_gis_driver.actinia_processing.base import \
Node, check_node_parents, DataObject, GrassDataType, \
create_output_name
from openeo_grass_gis_driver.a... | true | true |
1c29bde8a80ba0fa2a1d31c2f542755f7cac9242 | 1,510 | py | Python | bot/convert_stablecoins.py | jnarowski/crypto-index-fund-bot | 95c2ffeb8e05a46aa8cc0e74d8cfb1077a5ae1ca | [
"MIT"
] | null | null | null | bot/convert_stablecoins.py | jnarowski/crypto-index-fund-bot | 95c2ffeb8e05a46aa8cc0e74d8cfb1077a5ae1ca | [
"MIT"
] | null | null | null | bot/convert_stablecoins.py | jnarowski/crypto-index-fund-bot | 95c2ffeb8e05a46aa8cc0e74d8cfb1077a5ae1ca | [
"MIT"
] | null | null | null | import typing as t
from . import exchanges
from .data_types import CryptoBalance, SupportedExchanges
from .user import User
from .utils import log
# convert all stablecoins of the purchasing currency into the purchasing currency so we can use it
# in binance, you need to purchase in USD and cannot purchase most curr... | 35.952381 | 138 | 0.731126 | import typing as t
from . import exchanges
from .data_types import CryptoBalance, SupportedExchanges
from .user import User
from .utils import log
def convert_stablecoins(user: User, exchange: SupportedExchanges, portfolio: t.List[CryptoBalance]) -> t.List[t.Dict]:
purchasing_currency = user.purchasing_currenc... | true | true |
1c29bf451ba9b5ddf7d5298169d60ea4e3492ee0 | 1,629 | py | Python | Medium/1027.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 6 | 2017-09-25T18:05:50.000Z | 2019-03-27T00:23:15.000Z | Medium/1027.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | 1 | 2017-10-29T12:04:41.000Z | 2018-08-16T18:00:37.000Z | Medium/1027.py | Hellofafar/Leetcode | 7a459e9742958e63be8886874904e5ab2489411a | [
"CNRI-Python"
] | null | null | null | # ------------------------------
# 1027. Longest Arithmetic Sequence
#
# Description:
# Given an array A of integers, return the length of the longest arithmetic subsequence in A.
# Recall that a subsequence of A is a list A[i_1], A[i_2], ..., A[i_k] with 0 <= i_1 < i_2 <
# ... < i_k <= A.length - 1, and that a sequ... | 29.618182 | 134 | 0.578269 |
class Solution:
def longestArithSeqLength(self, A: List[int]) -> int:
dp = {}
for i in range(len(A)):
for j in range(i+1, len(A)):
dp[j, A[j] - A[i]] = dp.get((i, A[j] - A[i]), 1) + 1
return max(dp.values())
... | true | true |
1c29bfb6e8eb003b61bb65b49ac464ce306171bb | 25,020 | py | Python | tests/test_response_parser.py | diabolical-ninja/smart-property-search | 0931c7c8195ec21cbd56768c9c84cea2927a9e1d | [
"MIT"
] | 5 | 2021-04-12T04:10:42.000Z | 2021-04-28T05:54:22.000Z | tests/test_response_parser.py | diabolical-ninja/smart-property-search | 0931c7c8195ec21cbd56768c9c84cea2927a9e1d | [
"MIT"
] | 35 | 2020-05-26T14:21:37.000Z | 2022-03-29T16:14:42.000Z | tests/test_response_parser.py | diabolical-ninja/smart-property-search | 0931c7c8195ec21cbd56768c9c84cea2927a9e1d | [
"MIT"
] | 2 | 2020-05-26T14:02:12.000Z | 2022-01-10T08:19:49.000Z | """Unit tests for src/response_parser.py."""
import os
import sys
import pytest
sys.path.append(os.path.join(os.getcwd(), "src"))
from response_parser import ( # noqa
clean_domain,
clean_response,
clean_travel_info,
clean_walkscore,
)
sample_one = {
"type": "PropertyListing",
"listing":... | 36.472303 | 303 | 0.464189 |
import os
import sys
import pytest
sys.path.append(os.path.join(os.getcwd(), "src"))
from response_parser import (
clean_domain,
clean_response,
clean_travel_info,
clean_walkscore,
)
sample_one = {
"type": "PropertyListing",
"listing": {
"promo_level": None,
"listing_ty... | true | true |
1c29c067f1a9c6a0529e23342783af60c926028c | 3,187 | py | Python | ProblemSolving/Algorithms/Sorting/lilysHomework.py | ScottGarland/HackerRank | 984610e00c3244ec59a1c922147e964699fe2ec4 | [
"MIT"
] | null | null | null | ProblemSolving/Algorithms/Sorting/lilysHomework.py | ScottGarland/HackerRank | 984610e00c3244ec59a1c922147e964699fe2ec4 | [
"MIT"
] | null | null | null | ProblemSolving/Algorithms/Sorting/lilysHomework.py | ScottGarland/HackerRank | 984610e00c3244ec59a1c922147e964699fe2ec4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/lilys-homework/problem
def swap_count(arr, ascend = True, descend = False):
"""
The function counts the minimum number of swaps needed.
:param: arr is the input array given by HackerRank
:param: ascend is a boolean value for sorting in ascending order
:param... | 41.934211 | 110 | 0.684029 |
def swap_count(arr, ascend = True, descend = False):
arr = arr[:]
ascend = ascend # boolean value to determine to do the algo in ascending sort order
descend = descend # same as above but descending sort order
reverse = None # direction for sorted() function
error = None
# we want to ke... | true | true |
1c29c0755ff8d98da82a0a22b463fd7663943113 | 5,447 | py | Python | surrogate/selection/selSPEA2.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | 3 | 2021-01-06T03:01:18.000Z | 2022-03-21T03:02:55.000Z | surrogate/selection/selSPEA2.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | surrogate/selection/selSPEA2.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Quan Pan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 38.907143 | 89 | 0.568753 |
import math
from .utils import randomizedSelect
def selSPEA2(individuals, k):
N = len(individuals)
L = len(individuals[0].fitness.values)
K = math.sqrt(N)
strength_fits = [0] * N
fits = [0] * N
dominating_inds = [list() for i in xrange(N)]
for i, ind_i in enumerate(indiv... | true | true |
1c29c20717cc8e325f37e0064dfb224760b3f0b1 | 1,604 | py | Python | datasets/UCY/students03/px2ground.py | fengzileee/OpenTraj | 71fdfd1e3420d6a3859ae0acaa4acf85abbc1f64 | [
"MIT"
] | 232 | 2020-08-26T10:16:10.000Z | 2022-03-26T08:39:44.000Z | datasets/UCY/students03/px2ground.py | fengzileee/OpenTraj | 71fdfd1e3420d6a3859ae0acaa4acf85abbc1f64 | [
"MIT"
] | 15 | 2020-09-25T15:50:05.000Z | 2022-03-28T19:06:07.000Z | datasets/UCY/students03/px2ground.py | fengzileee/OpenTraj | 71fdfd1e3420d6a3859ae0acaa4acf85abbc1f64 | [
"MIT"
] | 63 | 2020-08-24T13:45:57.000Z | 2022-03-26T08:39:52.000Z | import numpy as np
def project(Hinv, loc):
locHomogenous = np.hstack((loc, 1))
locHomogenous = np.dot(Hinv, locHomogenous) # to camera frame
locXYZ = locHomogenous / locHomogenous[2] # to pixels (from millimeters)
return locXYZ[:2]
annot_file = './obsmat_px.txt'
annot_file_out = './obsmat.txt'
H_i... | 24.676923 | 102 | 0.568579 | import numpy as np
def project(Hinv, loc):
locHomogenous = np.hstack((loc, 1))
locHomogenous = np.dot(Hinv, locHomogenous)
locXYZ = locHomogenous / locHomogenous[2]
return locXYZ[:2]
annot_file = './obsmat_px.txt'
annot_file_out = './obsmat.txt'
H_iw = np.loadtxt('./H.txt')
in_file = open(annot... | true | true |
1c29c2b9e130f60615c0116828a1834784565b3e | 9,937 | py | Python | gym_rock_paper_scissors/envs/rock_paper_scissors_env.py | kyuhyoung/gym-rock-paper-scissors | f527c9f0835193008f04575bca1b63a815c44c8a | [
"MIT"
] | 5 | 2020-02-17T16:29:22.000Z | 2022-01-24T15:42:49.000Z | gym_rock_paper_scissors/envs/rock_paper_scissors_env.py | kyuhyoung/gym-rock-paper-scissors | f527c9f0835193008f04575bca1b63a815c44c8a | [
"MIT"
] | 1 | 2019-01-15T16:09:36.000Z | 2019-01-15T16:09:36.000Z | gym_rock_paper_scissors/envs/rock_paper_scissors_env.py | kyuhyoung/gym-rock-paper-scissors | f527c9f0835193008f04575bca1b63a815c44c8a | [
"MIT"
] | 3 | 2019-01-09T09:44:54.000Z | 2021-09-06T01:04:25.000Z | from enum import Enum
from copy import deepcopy
import numpy as np
import gym
from gym.spaces import Discrete, Tuple
from .one_hot_space import OneHotEncoding
class Action(Enum):
ROCK = 0
PAPER = 1
SCISSORS = 2
class RockPaperScissorsEnv(gym.Env):
'''
Repeated game of Rock Paper scissor... | 49.193069 | 131 | 0.686626 | from enum import Enum
from copy import deepcopy
import numpy as np
import gym
from gym.spaces import Discrete, Tuple
from .one_hot_space import OneHotEncoding
class Action(Enum):
ROCK = 0
PAPER = 1
SCISSORS = 2
class RockPaperScissorsEnv(gym.Env):
def __init__(self, stacked_observations=3,... | true | true |
1c29c33eda3db8f3f2f37eec0e4d8788db80d1a5 | 236 | py | Python | Cursos-Extras/Python/ex011.py | talessantos49/Primeiros_Passos | 7eac781fb3663c8cf71629611981d0ebd9f0216f | [
"MIT"
] | null | null | null | Cursos-Extras/Python/ex011.py | talessantos49/Primeiros_Passos | 7eac781fb3663c8cf71629611981d0ebd9f0216f | [
"MIT"
] | null | null | null | Cursos-Extras/Python/ex011.py | talessantos49/Primeiros_Passos | 7eac781fb3663c8cf71629611981d0ebd9f0216f | [
"MIT"
] | null | null | null | n1 = float(input('Qual a altura da parede? '))
n2 = float(input('Qual a largura da parede? '))
n3 = n1 * n2
n4 = n3/2
print('A area da parede é {:.2f}m², será necessario {:.2f} litros de tinta para pinta-lá por completo'.format(n3, n4)) | 47.2 | 118 | 0.669492 | n1 = float(input('Qual a altura da parede? '))
n2 = float(input('Qual a largura da parede? '))
n3 = n1 * n2
n4 = n3/2
print('A area da parede é {:.2f}m², será necessario {:.2f} litros de tinta para pinta-lá por completo'.format(n3, n4)) | true | true |
1c29c43a83be06fa143e5584bca7154d4b9b09f9 | 11,202 | py | Python | synapse/handlers/appservice.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | synapse/handlers/appservice.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | synapse/handlers/appservice.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket 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 applica... | 35.789137 | 89 | 0.593823 |
from twisted.internet import defer
from six import itervalues
import synapse
from synapse.api.constants import EventTypes
from synapse.util.metrics import Measure
from synapse.util.logcontext import (
make_deferred_yieldable, run_in_background,
)
from prometheus_client import Counter
import loggin... | true | true |
1c29c44870318b430c48fec56eae577e9da1e6d0 | 3,329 | py | Python | photomanip/tests/test_grouper.py | whlteXbread/photoManip | 623b1ca99dd2bde4082717d51e0f02a239b4f4ff | [
"MIT"
] | 5 | 2017-01-19T23:14:58.000Z | 2020-03-31T14:10:07.000Z | photomanip/tests/test_grouper.py | whlteXbread/photoManip | 623b1ca99dd2bde4082717d51e0f02a239b4f4ff | [
"MIT"
] | 12 | 2019-11-03T20:07:57.000Z | 2020-09-11T00:09:32.000Z | photomanip/tests/test_grouper.py | whlteXbread/photoManip | 623b1ca99dd2bde4082717d51e0f02a239b4f4ff | [
"MIT"
] | null | null | null | from nose import tools
from photomanip import PAD, CROP
from photomanip.grouper import FileSystemGrouper
class TestFileSystemGrouper:
@classmethod
def setup_class(cls):
cls.fs_grouper_tag = FileSystemGrouper(
'photomanip/tests/',
'faceit365:date='
)
cls.fs_grou... | 35.042105 | 71 | 0.632923 | from nose import tools
from photomanip import PAD, CROP
from photomanip.grouper import FileSystemGrouper
class TestFileSystemGrouper:
@classmethod
def setup_class(cls):
cls.fs_grouper_tag = FileSystemGrouper(
'photomanip/tests/',
'faceit365:date='
)
cls.fs_grou... | true | true |
1c29c456058b64daf81535b24186642985b724b3 | 164 | py | Python | math/signal.py | CospanDesign/python | 9f911509aae7abd9237c14a4635294c7719c9129 | [
"MIT"
] | 5 | 2015-12-12T20:16:45.000Z | 2020-02-21T19:50:31.000Z | math/signal.py | CospanDesign/python | 9f911509aae7abd9237c14a4635294c7719c9129 | [
"MIT"
] | null | null | null | math/signal.py | CospanDesign/python | 9f911509aae7abd9237c14a4635294c7719c9129 | [
"MIT"
] | 2 | 2020-06-01T06:27:06.000Z | 2022-03-10T13:21:03.000Z |
class Signal(object):
def __init__(self):
self.V = 0
self.I = 0
self.RIMP = 0
self.JIMP = 0
def step(self):
pass
| 13.666667 | 23 | 0.469512 |
class Signal(object):
def __init__(self):
self.V = 0
self.I = 0
self.RIMP = 0
self.JIMP = 0
def step(self):
pass
| true | true |
1c29c4b0a43fa9e772e2e95c344af1a042fa9376 | 7,521 | py | Python | core/slack.py | nqb/Osmedeus | cb14c98d823a3bb13bd266aacc3d01b957c360dc | [
"MIT"
] | 2 | 2019-05-19T18:05:10.000Z | 2019-06-15T10:19:54.000Z | core/slack.py | nhanledinh/Osmedeus | 6e9c259774abb672ef2ffa5770b865880623af54 | [
"MIT"
] | null | null | null | core/slack.py | nhanledinh/Osmedeus | 6e9c259774abb672ef2ffa5770b865880623af54 | [
"MIT"
] | 1 | 2019-05-19T18:05:24.000Z | 2019-05-19T18:05:24.000Z | '''
Sending message to Slack
'''
import os
import requests
import json
import time
import random
###Slack printing
def slack_seperate(options):
if options['BOT_TOKEN'] == "None":
return
mess = {
'title': "Just Seperated stuff",
'color': "#44475A",
'image_url': get_emoji(),
... | 30.084 | 184 | 0.570004 | import os
import requests
import json
import time
import random
if options['BOT_TOKEN'] == "None":
return
mess = {
'title': "Just Seperated stuff",
'color': "#44475A",
'image_url': get_emoji(),
'icon': get_emoji(),
}
sm = Messages(options)
mess['channel'] = ... | true | true |
1c29c551aac3871c2d69970512e9b2d4594c5190 | 7,465 | py | Python | tests/test_cookies.py | myuz/sanic | 58e15134fdc934ff423a0c710dad76d45368d493 | [
"MIT"
] | 2 | 2021-02-20T12:22:10.000Z | 2021-02-20T12:26:15.000Z | tests/test_cookies.py | myuz/sanic | 58e15134fdc934ff423a0c710dad76d45368d493 | [
"MIT"
] | 11 | 2021-07-10T17:14:47.000Z | 2022-02-24T07:32:36.000Z | tests/test_cookies.py | myuz/sanic | 58e15134fdc934ff423a0c710dad76d45368d493 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from http.cookies import SimpleCookie
import pytest
from sanic.cookies import Cookie
from sanic.response import text
# ------------------------------------------------------------ #
# GET
# ------------------------------------------------------------ #
def test_cookies(ap... | 31.23431 | 79 | 0.634293 | from datetime import datetime, timedelta
from http.cookies import SimpleCookie
import pytest
from sanic.cookies import Cookie
from sanic.response import text
def test_cookies(app):
@app.route("/")
def handler(request):
cookie_value = request.cookies["test"]
response = text(f"Cookies are: ... | true | true |
1c29c5b93b3e1d6d3bf48ff2e83761b8f2908c93 | 3,952 | py | Python | src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py | chef-davin/azure-cli | 2ebd33d5f69a27d07404cc48cf475d5fbdda6378 | [
"MIT"
] | 1 | 2020-07-02T23:41:03.000Z | 2020-07-02T23:41:03.000Z | src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py | cindywu/azure-cli | bd011cb91ac6e0ac89f53e1105d76ea30b6609a0 | [
"MIT"
] | 1 | 2021-06-02T04:24:22.000Z | 2021-06-02T04:24:22.000Z | src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_oauth.py | cindywu/azure-cli | bd011cb91ac6e0ac89f53e1105d76ea30b6609a0 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 51.324675 | 119 | 0.615891 |
import os
from azure.cli.testsdk import (ScenarioTest, JMESPathCheck, ResourceGroupPreparer,
StorageAccountPreparer, api_version_constraint, record_only)
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.core.profiles import ResourceType
from ..storage_test_u... | true | true |
1c29c63e818ca4004aecee8d5f3c7797ecf5612e | 3,816 | py | Python | airbyte-integrations/connectors/source-posthog/source_posthog/source.py | dsdorazio/airbyte | 078c6604a499c5ab68beb403d80b3068e6bef4ab | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-posthog/source_posthog/source.py | dsdorazio/airbyte | 078c6604a499c5ab68beb403d80b3068e6bef4ab | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-posthog/source_posthog/source.py | dsdorazio/airbyte | 078c6604a499c5ab68beb403d80b3068e6bef4ab | [
"MIT"
] | null | null | null | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 42.4 | 118 | 0.718291 |
from typing import Any, List, Mapping, Tuple
import pendulum
import requests
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http.a... | true | true |
1c29c6717099eef5374f68ca8190022df79ffc51 | 4,574 | py | Python | Footy/UnsupportedBantzStrings.py | schleising/banter-bot | 3e51453ae993d2c26dc51464a3cef3875a6be3c9 | [
"Apache-2.0"
] | null | null | null | Footy/UnsupportedBantzStrings.py | schleising/banter-bot | 3e51453ae993d2c26dc51464a3cef3875a6be3c9 | [
"Apache-2.0"
] | 2 | 2022-03-27T10:44:38.000Z | 2022-03-28T19:24:39.000Z | Footy/UnsupportedBantzStrings.py | schleising/banter-bot | 3e51453ae993d2c26dc51464a3cef3875a6be3c9 | [
"Apache-2.0"
] | 1 | 2022-03-28T11:45:47.000Z | 2022-03-28T11:45:47.000Z | # {team} -> Name of team
# {name} -> Name of person who supports team
teamMatchStarted: list[str] = [
"{team} are shit",
"{team} cunts",
"Dirty {team}",
"Dirty {team}, dirty {name}",
]
drawing: list[str] = [
"{team} level, this is a shit match",
"Boring old {team}",
"Happy with how it's go... | 34.390977 | 131 | 0.622868 |
teamMatchStarted: list[str] = [
"{team} are shit",
"{team} cunts",
"Dirty {team}",
"Dirty {team}, dirty {name}",
]
drawing: list[str] = [
"{team} level, this is a shit match",
"Boring old {team}",
"Happy with how it's going, {name}?",
"Yawn...",
"{team} wankers",
"How can you... | true | true |
1c29c682ec78eb50512307eb0d02b343ed275476 | 42,006 | py | Python | wo/cli/plugins/debug.py | vctocloud/WordOps | ad9505482a380d3433c642dad4e2cdb64bf4ca7e | [
"MIT"
] | 1 | 2019-07-13T10:25:15.000Z | 2019-07-13T10:25:15.000Z | wo/cli/plugins/debug.py | umahmadx/WordOps | f7360687f379bdd711c51b746dfa358317a880bd | [
"MIT"
] | null | null | null | wo/cli/plugins/debug.py | umahmadx/WordOps | f7360687f379bdd711c51b746dfa358317a880bd | [
"MIT"
] | null | null | null | """Debug Plugin for WordOps"""
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from wo.core.aptget import WOAptGet
from wo.core.shellexec import *
from wo.core.mysql import WOMysql
from wo.core.services import WOService
from wo.core.logging import Log
from wo.cli.p... | 49.418824 | 89 | 0.45284 |
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from wo.core.aptget import WOAptGet
from wo.core.shellexec import *
from wo.core.mysql import WOMysql
from wo.core.services import WOService
from wo.core.logging import Log
from wo.cli.plugins.site_functions import lo... | true | true |
1c29c7924f8339173debbb5b7aa90f9fd84d5e44 | 143 | py | Python | odp_sdk/utils/__init__.py | C4IROcean/odp-sdk-python | 3ae4cc565dd6d7be75b3bc5df09371f75b47dd0d | [
"Apache-2.0"
] | 6 | 2020-09-29T14:35:03.000Z | 2021-06-02T07:33:15.000Z | odp_sdk/utils/__init__.py | C4IROcean/odp-sdk-python | 3ae4cc565dd6d7be75b3bc5df09371f75b47dd0d | [
"Apache-2.0"
] | 2 | 2020-11-13T12:24:57.000Z | 2021-01-25T12:00:50.000Z | odp_sdk/utils/__init__.py | C4IROcean/odp-sdk-python | 3ae4cc565dd6d7be75b3bc5df09371f75b47dd0d | [
"Apache-2.0"
] | 1 | 2020-12-05T12:15:44.000Z | 2020-12-05T12:15:44.000Z | from .odp_geo import (
index_to_gcs,
index_to_grid,
gcs_to_index,
gcs_to_grid,
grid_rect_members,
index_rect_members
)
| 15.888889 | 22 | 0.699301 | from .odp_geo import (
index_to_gcs,
index_to_grid,
gcs_to_index,
gcs_to_grid,
grid_rect_members,
index_rect_members
)
| true | true |
1c29ca416750bfa0887471e15d0a098f40a35f97 | 17,015 | py | Python | src/cc_catalog_airflow/dags/provider_api_scripts/test_flickr.py | AyanChoudhary/cccatalog | ca2b247fffc0f38ec6b73574f963dd94a9505c86 | [
"MIT"
] | 1 | 2020-05-16T01:56:40.000Z | 2020-05-16T01:56:40.000Z | src/cc_catalog_airflow/dags/provider_api_scripts/test_flickr.py | AyanChoudhary/cccatalog | ca2b247fffc0f38ec6b73574f963dd94a9505c86 | [
"MIT"
] | null | null | null | src/cc_catalog_airflow/dags/provider_api_scripts/test_flickr.py | AyanChoudhary/cccatalog | ca2b247fffc0f38ec6b73574f963dd94a9505c86 | [
"MIT"
] | null | null | null | import json
import logging
import os
import requests
from unittest.mock import patch, MagicMock
import flickr
RESOURCES = os.path.join(
os.path.abspath(os.path.dirname(__file__)), 'tests/resources/flickr'
)
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s: %(message)s',
level=logging.... | 33.038835 | 142 | 0.681693 | import json
import logging
import os
import requests
from unittest.mock import patch, MagicMock
import flickr
RESOURCES = os.path.join(
os.path.abspath(os.path.dirname(__file__)), 'tests/resources/flickr'
)
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s: %(message)s',
level=logging.... | true | true |
1c29cb0137a8731e7e6fafdfdad716c65b8a86b4 | 94 | py | Python | apps/account/apps.py | martinlehoux/django_bike | 05373d2649647fe8ebadb0aad54b9a7ec1900fe7 | [
"MIT"
] | 1 | 2020-08-12T17:53:37.000Z | 2020-08-12T17:53:37.000Z | apps/account/apps.py | martinlehoux/django_bike | 05373d2649647fe8ebadb0aad54b9a7ec1900fe7 | [
"MIT"
] | 12 | 2020-07-03T03:52:00.000Z | 2021-09-22T18:00:44.000Z | apps/account/apps.py | martinlehoux/django_bike | 05373d2649647fe8ebadb0aad54b9a7ec1900fe7 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class AccountConfig(AppConfig):
name = "apps.account"
| 15.666667 | 33 | 0.755319 | from django.apps import AppConfig
class AccountConfig(AppConfig):
name = "apps.account"
| true | true |
1c29cb6db043ab8c970992f064b7c218cd51b81f | 2,111 | py | Python | examples/python/mg811.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 619 | 2015-01-14T23:50:18.000Z | 2019-11-08T14:04:33.000Z | examples/python/mg811.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 576 | 2015-01-02T09:55:14.000Z | 2019-11-12T15:31:10.000Z | examples/python/mg811.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 494 | 2015-01-14T18:33:56.000Z | 2019-11-07T10:08:15.000Z | #!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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
# witho... | 37.035088 | 82 | 0.730933 |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_mg811 as sensorObj
def main():
sensor = sensorObj.MG811(0, 2, 5.0)
andler(signum, frame):
raise SystemExit
def exitHandler():
print("Exiting")
sys.ex... | true | true |
1c29cb9cb876e935c9d4169b91a8667fd6acd458 | 502 | py | Python | crudbuilder/signals.py | xlfds/django-crudbuilder | dd491ae4802a54802d41e62444fa8fab93be1670 | [
"Apache-2.0"
] | 1 | 2016-08-09T09:16:22.000Z | 2016-08-09T09:16:22.000Z | crudbuilder/signals.py | xlfds/django-crudbuilder | dd491ae4802a54802d41e62444fa8fab93be1670 | [
"Apache-2.0"
] | null | null | null | crudbuilder/signals.py | xlfds/django-crudbuilder | dd491ae4802a54802d41e62444fa8fab93be1670 | [
"Apache-2.0"
] | 1 | 2021-07-27T07:21:42.000Z | 2021-07-27T07:21:42.000Z | from django.dispatch import Signal
# post save signals for single model instance
post_create_signal = Signal()
post_update_signal = Signal()
# post save signals for inline formset
post_inline_create_signal = Signal()
post_inline_update_signal = Signal()
crudbuilder_signals = {
'inlineformset': {
'create... | 22.818182 | 45 | 0.713147 | from django.dispatch import Signal
post_create_signal = Signal()
post_update_signal = Signal()
post_inline_create_signal = Signal()
post_inline_update_signal = Signal()
crudbuilder_signals = {
'inlineformset': {
'create': post_inline_create_signal,
'update': post_inline_update_signal
},
... | true | true |
1c29cbbc4dde67e11d4b5769628b985d63d87dfd | 3,012 | py | Python | moodle/__main__.py | 4ndu-7h4k/MoodleAutoAttedence | f4e7540a484511d3d310e37cc180d277f31caf83 | [
"MIT"
] | null | null | null | moodle/__main__.py | 4ndu-7h4k/MoodleAutoAttedence | f4e7540a484511d3d310e37cc180d277f31caf83 | [
"MIT"
] | null | null | null | moodle/__main__.py | 4ndu-7h4k/MoodleAutoAttedence | f4e7540a484511d3d310e37cc180d277f31caf83 | [
"MIT"
] | 1 | 2021-11-24T13:50:51.000Z | 2021-11-24T13:50:51.000Z | from moodle import log, ENDC, GREEN, WARNING, START_TIME, END_TIME, CYAN, RED
from urllib.parse import urlparse, parse_qs
from moodle.attendence import attendence
from moodle.telegrambot import send
from bs4 import BeautifulSoup
from datetime import datetime
from pytz import timezone
import schedule, time
import reques... | 35.023256 | 95 | 0.515936 | from moodle import log, ENDC, GREEN, WARNING, START_TIME, END_TIME, CYAN, RED
from urllib.parse import urlparse, parse_qs
from moodle.attendence import attendence
from moodle.telegrambot import send
from bs4 import BeautifulSoup
from datetime import datetime
from pytz import timezone
import schedule, time
import reques... | true | true |
1c29cbf9975872cf0d5d6f186c2c777243f439eb | 76 | py | Python | ocd_backend/utils/__init__.py | ngi-nix/poliscoops | 491d12f83a44afbb4f1ee525b29ae70dc564e0f7 | [
"CC-BY-4.0"
] | 13 | 2015-02-27T01:46:31.000Z | 2021-12-27T18:08:31.000Z | ocd_backend/utils/__init__.py | ngi-nix/poliscoops | 491d12f83a44afbb4f1ee525b29ae70dc564e0f7 | [
"CC-BY-4.0"
] | 68 | 2015-01-05T15:15:30.000Z | 2022-03-11T23:13:05.000Z | ocd_backend/utils/__init__.py | acidburn0zzz/open-cultuur-data | 59af74f2fcb97b53f250518f46882d8ec7613ec3 | [
"CC-BY-4.0"
] | 10 | 2015-01-09T14:01:07.000Z | 2018-04-13T14:27:07.000Z | from .misc import DatetimeJSONEncoder
json_encoder = DatetimeJSONEncoder()
| 19 | 37 | 0.842105 | from .misc import DatetimeJSONEncoder
json_encoder = DatetimeJSONEncoder()
| true | true |
1c29cc050060e69bd463c907f44d8118d9a948d1 | 8,612 | py | Python | docs/source/topics/transport_template.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 1 | 2016-09-12T10:51:00.000Z | 2016-09-12T10:51:00.000Z | docs/source/topics/transport_template.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 17 | 2020-03-11T17:04:05.000Z | 2020-05-01T09:34:45.000Z | docs/source/topics/transport_template.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from aiida.transports import Transport
class NewTransport(Transport):
def __init__(self, machine, **kwargs):
"""Initialize the Transport class.
:param machine: the machine to connect to
"""
def __enter__(self):
"""Open the connection."""
def __ex... | 35.295082 | 120 | 0.645611 |
from aiida.transports import Transport
class NewTransport(Transport):
def __init__(self, machine, **kwargs):
def __enter__(self):
def __exit__(self, type, value, traceback):
def chdir(self, path):
def chmod(self, path, mode):
def copy(self, remotesource, remotedestination, *args, **kwar... | true | true |
1c29cc55824b1e78335f2a4cee35358a5f4ad53f | 3,847 | py | Python | djangox/lib/python3.8/site-packages/oauthlib/openid/connect/core/endpoints/userinfo.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 954 | 2018-01-27T11:00:51.000Z | 2022-03-31T16:04:42.000Z | djangox/lib/python3.8/site-packages/oauthlib/openid/connect/core/endpoints/userinfo.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 274 | 2018-01-27T08:36:01.000Z | 2022-03-22T04:40:40.000Z | djangox/lib/python3.8/site-packages/oauthlib/openid/connect/core/endpoints/userinfo.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 191 | 2018-02-15T12:12:45.000Z | 2022-03-31T22:38:13.000Z | """
oauthlib.openid.connect.core.endpoints.userinfo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of userinfo endpoint.
"""
import json
import logging
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.oauth2.rfc6749.endpoints.base imp... | 38.47 | 88 | 0.660515 | import json
import logging
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.oauth2.rfc6749.endpoints.base import (
BaseEndpoint, catch_errors_and_unavailability,
)
from oauthlib.oauth2.rfc6749.tokens import BearerToken
log = logging.getLogger(__name__)
class UserInfoE... | true | true |
1c29cc733fccc1516fe57357e8090152e8143c32 | 2,321 | py | Python | ins/ins_registry/ins_registry.py | PhyrexTsai/ins | ad136424a372a3671ab8aa8004c915c26aa6e3d2 | [
"MIT"
] | null | null | null | ins/ins_registry/ins_registry.py | PhyrexTsai/ins | ad136424a372a3671ab8aa8004c915c26aa6e3d2 | [
"MIT"
] | null | null | null | ins/ins_registry/ins_registry.py | PhyrexTsai/ins | ad136424a372a3671ab8aa8004c915c26aa6e3d2 | [
"MIT"
] | null | null | null | from iconservice import *
import re
class INSRegistry(IconScoreBase):
__HOLDER = 'holder'
__RESOLVER = 'resolver'
__TTL = 'ttl'
@eventlog(indexed=2)
def Transfer(self, node: str, holder: Address): pass
@eventlog(indexed=3)
def NewHolder(self, node: str, label: str, holder: Address): pass... | 31.364865 | 83 | 0.617837 | from iconservice import *
import re
class INSRegistry(IconScoreBase):
__HOLDER = 'holder'
__RESOLVER = 'resolver'
__TTL = 'ttl'
@eventlog(indexed=2)
def Transfer(self, node: str, holder: Address): pass
@eventlog(indexed=3)
def NewHolder(self, node: str, label: str, holder: Address): pass... | true | true |
1c29cd725d84cf362de4c0b82dab4a78ea1506c5 | 128 | py | Python | bench/fibrec.py | codr7/alisp | 05ac47ab2c28683373af4ec80e5a94937390fa6c | [
"MIT"
] | 8 | 2021-09-04T10:18:49.000Z | 2022-01-10T01:05:13.000Z | bench/fibrec.py | codr7/alisp | 05ac47ab2c28683373af4ec80e5a94937390fa6c | [
"MIT"
] | null | null | null | bench/fibrec.py | codr7/alisp | 05ac47ab2c28683373af4ec80e5a94937390fa6c | [
"MIT"
] | 2 | 2021-10-05T11:00:14.000Z | 2021-10-11T05:54:59.000Z | from bench import bench
print(bench(100, '''
def fib(n):
return n if n < 2 else fib(n-1) + fib(n-2)
''', '''
fib(20)
'''))
| 14.222222 | 44 | 0.546875 | from bench import bench
print(bench(100, '''
def fib(n):
return n if n < 2 else fib(n-1) + fib(n-2)
''', '''
fib(20)
'''))
| true | true |
1c29ce13bd5f5fe3f449da09a2d8e60e2ac65c3c | 955 | py | Python | scripts/vt-uploader.py | forkd/corsair | c854aed4b8b7f5d4b29610fc2b65881db6a0fb8f | [
"MIT"
] | 7 | 2019-05-01T00:04:02.000Z | 2019-10-04T18:22:59.000Z | scripts/vt-uploader.py | lopes/corsair | c854aed4b8b7f5d4b29610fc2b65881db6a0fb8f | [
"MIT"
] | null | null | null | scripts/vt-uploader.py | lopes/corsair | c854aed4b8b7f5d4b29610fc2b65881db6a0fb8f | [
"MIT"
] | 3 | 2019-05-04T04:05:15.000Z | 2020-01-20T17:29:30.000Z | #!/usr/bin/env python3
# This script uploads large files (between 32 and 200 MB) to
# VirusTotal for further analysis.
#
# Usage:
# $ python vt-uploader.py file
#
# Author: José Lopes
# License: MIT
##
from sys import argv
from pprint import pprint
from time import sleep
from requests import post
from corsair.chron... | 25.131579 | 72 | 0.640838 |
from sys import argv
from pprint import pprint
from time import sleep
from requests import post
from corsair.chronicle.virustotal import Api
vt_apikey = ''
vt_apiurl = 'https://www.virustotal.com/vtapi/v2'
wait_time = 20
if __name__ == '__main__':
with open(argv[1], 'rb') as f:
vt = Api(vt... | true | true |
1c29cf17a0b38fd8f1018095f77aa016cfbf9f8d | 2,993 | py | Python | ocs_ci/ocs/defaults.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | 130 | 2019-04-08T06:22:53.000Z | 2022-03-23T06:11:19.000Z | ocs_ci/ocs/defaults.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | 4,359 | 2019-04-09T18:48:47.000Z | 2022-03-31T20:04:55.000Z | ocs_ci/ocs/defaults.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | 183 | 2019-04-18T15:55:30.000Z | 2022-03-11T06:16:50.000Z | """
Defaults module. All the defaults used by OSCCI framework should
reside in this module.
PYTEST_DONT_REWRITE - avoid pytest to rewrite, keep this msg here please!
"""
import os
from ocs_ci.ocs import constants
STORAGE_API_VERSION = "storage.k8s.io/v1"
ROOK_API_VERSION = "ceph.rook.io/v1"
OCP_API_VERSION = "project... | 32.182796 | 78 | 0.748079 | import os
from ocs_ci.ocs import constants
STORAGE_API_VERSION = "storage.k8s.io/v1"
ROOK_API_VERSION = "ceph.rook.io/v1"
OCP_API_VERSION = "project.openshift.io/v1"
OPENSHIFT_REST_CLIENT_API_VERSION = "v1"
INSTALLER_VERSION = "4.1.4"
CLIENT_VERSION = INSTALLER_VERSION
SRE_BUILD_TEST_NAMESPACE = "openshift-build-... | true | true |
1c29cf47fd9a459dd5a1b41a8ec477b98e312eb4 | 9,818 | py | Python | mutation_counts/scripts/merge_maf.py | dfci/hotspot_logreg | fbd5585e69b39c54637ac240d23f974c5ae6e996 | [
"MIT"
] | null | null | null | mutation_counts/scripts/merge_maf.py | dfci/hotspot_logreg | fbd5585e69b39c54637ac240d23f974c5ae6e996 | [
"MIT"
] | null | null | null | mutation_counts/scripts/merge_maf.py | dfci/hotspot_logreg | fbd5585e69b39c54637ac240d23f974c5ae6e996 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
"""
SYNOPSIS
Merge data from multiple input MAF files into a single output MAF file.
NOTES
(a) Retain only the 34 standard MAF columns from the input MAF files.
All other columns in the input MAF file are discarded.
(b) Add a non-standard column ('Source_Maf') to the outpu... | 38.653543 | 105 | 0.653901 |
"""
SYNOPSIS
Merge data from multiple input MAF files into a single output MAF file.
NOTES
(a) Retain only the 34 standard MAF columns from the input MAF files.
All other columns in the input MAF file are discarded.
(b) Add a non-standard column ('Source_Maf') to the output MAF file to
... | false | true |
1c29cf8e9b80c135888c6593eb4898178ca30abe | 7,501 | py | Python | frontend/main.py | maxbbraun/wittgenstein | 1692a5cb71682565f8d2fb723267f7d087868b43 | [
"MIT"
] | 13 | 2022-01-07T20:58:05.000Z | 2022-03-23T12:26:08.000Z | frontend/main.py | maxbbraun/wittgenstein | 1692a5cb71682565f8d2fb723267f7d087868b43 | [
"MIT"
] | null | null | null | frontend/main.py | maxbbraun/wittgenstein | 1692a5cb71682565f8d2fb723267f7d087868b43 | [
"MIT"
] | 2 | 2022-01-18T16:23:09.000Z | 2022-01-29T15:46:44.000Z | from flask import abort
from flask import Flask
from flask import make_response
from flask import render_template
from flask import redirect
from flask import request
from flask import send_from_directory
from flask import url_for
from flask_minify import decorators
from flask_minify import minify
from google.cloud imp... | 29.648221 | 79 | 0.669377 | from flask import abort
from flask import Flask
from flask import make_response
from flask import render_template
from flask import redirect
from flask import request
from flask import send_from_directory
from flask import url_for
from flask_minify import decorators
from flask_minify import minify
from google.cloud imp... | true | true |
1c29d1295a6fabc485ea50dae5674b306f8ace57 | 2,122 | py | Python | nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py | vferat/nipype | 536c57da150d157dcb5c121af43aaeab71cdbd5f | [
"Apache-2.0"
] | 2 | 2018-04-17T19:18:16.000Z | 2020-03-04T22:05:02.000Z | nipype/interfaces/slicer/legacy/tests/test_auto_RigidRegistration.py | oesteban/nipype | c14f24eba1da08711bbb894e049ee858ed740096 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..registration import RigidRegistration
def test_RigidRegistration_inputs():
input_map = dict(
FixedImageFileName=dict(
argstr='%s',
extensions=None,
position=-2,
... | 32.646154 | 74 | 0.581998 |
from __future__ import unicode_literals
from ..registration import RigidRegistration
def test_RigidRegistration_inputs():
input_map = dict(
FixedImageFileName=dict(
argstr='%s',
extensions=None,
position=-2,
),
MovingImageFileName=dict(
args... | true | true |
1c29d275f5770418c1557ded59df5ac9ea855fcf | 8,444 | py | Python | VAE/utils.py | codedecde/VAE-MNIST | 53c1ae884c8f83e8e2b359aae0ec46946e117e8a | [
"MIT"
] | 2 | 2018-09-19T01:37:31.000Z | 2019-09-22T02:45:09.000Z | Testing/utils.py | codedecde/WordEmbeddings | 84e6cd5424b74da6e889dd1b6ab7a6c5df9432d9 | [
"MIT"
] | null | null | null | Testing/utils.py | codedecde/WordEmbeddings | 84e6cd5424b74da6e889dd1b6ab7a6c5df9432d9 | [
"MIT"
] | null | null | null | import numpy as np
import time
import sys
import os
'''
Utility functions
Taken from keras code : https://keras.io/
'''
def pad_sequences(sequences, maxlen=None, dtype='int32',
padding='pre', truncating='pre', value=0.):
"""Pads each sequence to the same length (length of the longest sequ... | 36.396552 | 114 | 0.534699 | import numpy as np
import time
import sys
import os
'''
Utility functions
Taken from keras code : https://keras.io/
'''
def pad_sequences(sequences, maxlen=None, dtype='int32',
padding='pre', truncating='pre', value=0.):
"""Pads each sequence to the same length (length of the longest sequ... | false | true |
1c29d378befbbe49ed621160d6b3b6a0d5914c55 | 79,394 | py | Python | test/unit/obj/test_ssync.py | aguirguis/swift | 2aaeab6f5ddfdbcd75eeee970287f08f19de19ef | [
"Apache-2.0"
] | null | null | null | test/unit/obj/test_ssync.py | aguirguis/swift | 2aaeab6f5ddfdbcd75eeee970287f08f19de19ef | [
"Apache-2.0"
] | null | null | null | test/unit/obj/test_ssync.py | aguirguis/swift | 2aaeab6f5ddfdbcd75eeee970287f08f19de19ef | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 - 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 44.107778 | 79 | 0.598761 |
from collections import defaultdict
import mock
import os
import time
import unittest
import eventlet
import itertools
from six.moves import urllib
from swift.common.exceptions import DiskFileNotExist, DiskFileError, \
DiskFileDeleted, DiskFileExpired
from swift.common import swob
from swift.common... | true | true |
1c29d3c04019fed305b8e87c17d900df837321f3 | 13,924 | py | Python | tests/test_api.py | para2x/sciann | 510a632f01a1db593e9c38338561c08826adcb34 | [
"MIT"
] | 139 | 2019-07-20T20:04:19.000Z | 2022-03-20T16:01:34.000Z | tests/test_api.py | para2x/sciann | 510a632f01a1db593e9c38338561c08826adcb34 | [
"MIT"
] | 34 | 2019-08-14T20:12:59.000Z | 2022-02-10T06:05:34.000Z | tests/test_api.py | para2x/sciann | 510a632f01a1db593e9c38338561c08826adcb34 | [
"MIT"
] | 67 | 2019-11-07T02:38:04.000Z | 2022-03-29T13:08:45.000Z | import pytest
import sciann as sn
import json
import os
import shutil
from tensorflow.keras import optimizers as tf_optimizers
import numpy as np
@pytest.fixture(scope="module")
def variable_x():
return sn.Variable('x')
@pytest.fixture(scope="module")
def variable_y():
return sn.Variable('y')
@pytest.fix... | 35.250633 | 194 | 0.686225 | import pytest
import sciann as sn
import json
import os
import shutil
from tensorflow.keras import optimizers as tf_optimizers
import numpy as np
@pytest.fixture(scope="module")
def variable_x():
return sn.Variable('x')
@pytest.fixture(scope="module")
def variable_y():
return sn.Variable('y')
@pytest.fix... | true | true |
1c29d7fbc6a66431f3ee7919138841046964a09a | 444 | py | Python | example/market/get_symbol_price_ticker.py | marioanloru/Binance_Futures_python | 948b86e0531c6d3584392be031fdcfb528fe1a6b | [
"MIT"
] | 1 | 2021-08-11T14:05:47.000Z | 2021-08-11T14:05:47.000Z | example/market/get_symbol_price_ticker.py | marioanloru/Binance_Futures_python | 948b86e0531c6d3584392be031fdcfb528fe1a6b | [
"MIT"
] | null | null | null | example/market/get_symbol_price_ticker.py | marioanloru/Binance_Futures_python | 948b86e0531c6d3584392be031fdcfb528fe1a6b | [
"MIT"
] | null | null | null | from binance_f import RequestClient
from binance_f.constant.test import *
from binance_f.base.printobject import *
request_client = RequestClient(api_key=g_api_key, secret_key=g_secret_key)
result = request_client.get_symbol_price_ticker()
# result = request_client.get_symbol_price_ticker(symbol="BTCUSDT")
... | 34.153846 | 75 | 0.702703 | from binance_f import RequestClient
from binance_f.constant.test import *
from binance_f.base.printobject import *
request_client = RequestClient(api_key=g_api_key, secret_key=g_secret_key)
result = request_client.get_symbol_price_ticker()
| true | true |
1c29d8737027e28746c2d8146c52b9e7c7287b47 | 321 | py | Python | ext/ply/test/lex_rule2.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 9,724 | 2015-01-01T02:06:30.000Z | 2019-01-17T15:13:51.000Z | ext/ply/test/lex_rule2.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 7,584 | 2019-01-17T22:58:27.000Z | 2022-03-31T23:10:22.000Z | ext/ply/test/lex_rule2.py | hyu-iot/gem5 | aeccc8bd8e9a86f96fc7a6f40d978f8494337fc5 | [
"BSD-3-Clause"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # lex_rule2.py
#
# Rule function with incorrect number of arguments
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
t_PLUS = r'\+'
t_MINUS = r'-'
def t_NUMBER():
r'\d+'
return t
def t_error(t):
pass
lex.lex()
... | 10.7 | 50 | 0.573209 |
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
t_PLUS = r'\+'
t_MINUS = r'-'
def t_NUMBER():
return t
def t_error(t):
pass
lex.lex()
| true | true |
1c29d91db5f4dc5d978ddcd1c9d48c5de15ab7a8 | 761 | py | Python | ex73 futebol.py | joaoschweikart/python_projects | a30361551ec71ac3bef6d38e4b6ffc7bad21f1cc | [
"MIT"
] | null | null | null | ex73 futebol.py | joaoschweikart/python_projects | a30361551ec71ac3bef6d38e4b6ffc7bad21f1cc | [
"MIT"
] | null | null | null | ex73 futebol.py | joaoschweikart/python_projects | a30361551ec71ac3bef6d38e4b6ffc7bad21f1cc | [
"MIT"
] | null | null | null |
brasileirao = ('Palmeiras', 'Flamengo', 'Internacional', 'Grêmio', 'São Paulo', 'Atlético Mineiro',
'Atlético-PR', 'Cruzeiro', 'Botafogo', 'Santos', 'Bahia', 'Corinthians', 'Fluminense',
'Ceará', 'Vasco da Gama', 'Sport Recife', 'América-MG', 'Chapecoense', 'Vitória', 'Paraná')
print('=-'... | 38.05 | 106 | 0.655716 |
brasileirao = ('Palmeiras', 'Flamengo', 'Internacional', 'Grêmio', 'São Paulo', 'Atlético Mineiro',
'Atlético-PR', 'Cruzeiro', 'Botafogo', 'Santos', 'Bahia', 'Corinthians', 'Fluminense',
'Ceará', 'Vasco da Gama', 'Sport Recife', 'América-MG', 'Chapecoense', 'Vitória', 'Paraná')
print('=-'... | true | true |
1c29d9f4547ec84c3af0358bf0e673655c3f4a1c | 2,364 | py | Python | simpleGames/TicTacToe.py | solothinker/Python-Xperiments | 13d4e7bf8a0ce3eec22537d71eb9e27dc1f4c4ef | [
"MIT"
] | null | null | null | simpleGames/TicTacToe.py | solothinker/Python-Xperiments | 13d4e7bf8a0ce3eec22537d71eb9e27dc1f4c4ef | [
"MIT"
] | null | null | null | simpleGames/TicTacToe.py | solothinker/Python-Xperiments | 13d4e7bf8a0ce3eec22537d71eb9e27dc1f4c4ef | [
"MIT"
] | null | null | null | #tic-tac-toe
import numpy as np
count = 0
def selectPlayer():
firstPlayer = input('Select between x or o:')
if firstPlayer != "x" and firstPlayer != "o":
print("Pleae select the right symbol")
firstPlayer = selectPlayer()
return firstPlayer
def printTic(tic):
for ii in tic:
te... | 25.148936 | 169 | 0.445008 |
import numpy as np
count = 0
def selectPlayer():
firstPlayer = input('Select between x or o:')
if firstPlayer != "x" and firstPlayer != "o":
print("Pleae select the right symbol")
firstPlayer = selectPlayer()
return firstPlayer
def printTic(tic):
for ii in tic:
temp = '|'
... | true | true |
1c29da3248228fe559d109409f0549b1bff16f9a | 991 | py | Python | manos-files/Section #1 - Basics/draw.py | manos-mark/opencv-course | 470f7572effacbfb999cbb8df802e388d59ce958 | [
"MIT"
] | null | null | null | manos-files/Section #1 - Basics/draw.py | manos-mark/opencv-course | 470f7572effacbfb999cbb8df802e388d59ce958 | [
"MIT"
] | null | null | null | manos-files/Section #1 - Basics/draw.py | manos-mark/opencv-course | 470f7572effacbfb999cbb8df802e388d59ce958 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
blank = np.zeros((500, 500, 3), dtype='uint8')
cv.imshow('Blank', blank)
# img = cv.imread('Resources/Photos/cat.jpg')
# cv.imshow('Cat', img)
""" 1. Paint the image a certain colour """
# blank[200:300, 300:400] = 0,255,0
# cv.imshow('Green', blank)
""" 2. Draw a Rectangle """
#... | 30.030303 | 96 | 0.628658 | import cv2 as cv
import numpy as np
blank = np.zeros((500, 500, 3), dtype='uint8')
cv.imshow('Blank', blank)
cv.rectangle(blank, (0,0), (blank.shape[1]//2, blank.shape[0]//2), (0,255,0), thickness=-1)
cv.circle(blank, (250,250), 40, (0,0,255), thickness=3)
cv.line(blank, (0,0), (blank.shape[1]//2, blank.... | true | true |
1c29da4a53d552fac631c223d777c1604915eedc | 7,868 | py | Python | training_ptr_gen/decode.py | yash-22/pointer_generator_translator | 86e4c96b6e9930cd7f35fd31d39477f916899da7 | [
"Apache-2.0"
] | null | null | null | training_ptr_gen/decode.py | yash-22/pointer_generator_translator | 86e4c96b6e9930cd7f35fd31d39477f916899da7 | [
"Apache-2.0"
] | null | null | null | training_ptr_gen/decode.py | yash-22/pointer_generator_translator | 86e4c96b6e9930cd7f35fd31d39477f916899da7 | [
"Apache-2.0"
] | null | null | null | #Except for the pytorch part content of this file is copied from https://github.com/abisee/pointer-generator/blob/master/
import sys
import imp
imp.reload(sys)
sys.setdefaultencoding('utf8')
import os
import time
import torch
from torch.autograd import Variable
from data_util.batcher import Batcher
from data_util.... | 37.826923 | 121 | 0.587316 |
import sys
import imp
imp.reload(sys)
sys.setdefaultencoding('utf8')
import os
import time
import torch
from torch.autograd import Variable
from data_util.batcher import Batcher
from data_util.data import Vocab
from data_util import data, config
from . import model
from data_util.utils import write_for_rouge, rou... | true | true |
1c29da5dceeb7423f395da8f3bf2cf281c092342 | 3,048 | py | Python | lib/multicore.py | casmlab/quac | f7b037b15f5ff0db1b9669159f645040abce1766 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2015-01-10T05:44:02.000Z | 2021-05-18T02:57:19.000Z | lib/multicore.py | casmlab/quac | f7b037b15f5ff0db1b9669159f645040abce1766 | [
"ECL-2.0",
"Apache-2.0"
] | 14 | 2015-02-15T21:58:09.000Z | 2020-06-05T18:31:47.000Z | lib/multicore.py | casmlab/quac | f7b037b15f5ff0db1b9669159f645040abce1766 | [
"ECL-2.0",
"Apache-2.0"
] | 19 | 2015-02-08T02:24:15.000Z | 2020-11-07T13:39:55.000Z | # Stuff to facilitate running multicore jobs. The basic philosophy here is to
# spawn a few large jobs instead of many small jobs, repacking small jobs into
# bigger ones if needed.
# Copyright (c) Los Alamos National Security, LLC, and others.
import itertools
import sys
import joblib
import testable
import u
... | 32.084211 | 79 | 0.639108 |
import itertools
import sys
import joblib
import testable
import u
core_ct = 1
def do(f, every, each, require_multicore=False):
assert (isinstance(every, tuple))
if (require_multicore and core_ct == 1):
raise ValueError('multicore forced, but core_ct == 1')
eaches = u.chunker(each, core_c... | true | true |
1c29daa89886356dd74486d80a4fe6067a3da7a7 | 2,789 | py | Python | encoding.py | AbdallahHemdan/LZ77-compression-algorithm | 03677b8c368bd7e84ea08dab9159c686e9fb3144 | [
"MIT"
] | null | null | null | encoding.py | AbdallahHemdan/LZ77-compression-algorithm | 03677b8c368bd7e84ea08dab9159c686e9fb3144 | [
"MIT"
] | null | null | null | encoding.py | AbdallahHemdan/LZ77-compression-algorithm | 03677b8c368bd7e84ea08dab9159c686e9fb3144 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
inputImg = cv2.imread('input.jpg', 0)
flat = np.array(inputImg).flatten()
cv2.imshow('input', inputImg)
# size of the image(row, col)
row = inputImg.shape[0]
col = inputImg.shape[1]
flattenSize = row * col
# get sliding window and look ahead window sizes
slidingWindow = int... | 32.057471 | 87 | 0.619577 | import numpy as np
import cv2
inputImg = cv2.imread('input.jpg', 0)
flat = np.array(inputImg).flatten()
cv2.imshow('input', inputImg)
row = inputImg.shape[0]
col = inputImg.shape[1]
flattenSize = row * col
slidingWindow = int(input('1. Enter the sliding window size: '))
lookAhead = int(input('2. Enter ... | true | true |
1c29dce3405c7b3152171e04e48c63c0b195faf4 | 121,443 | py | Python | tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.394878 | 128 | 0.685737 |
import os
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import future
from g... | true | true |
1c29ded66f061d9716e3aabec8a0a6ecab8f8b06 | 1,088 | py | Python | runner/runs/doom_health_gathering.py | neevparikh/hierarchical-doom | 082f794b9c6101c4e94f15bf4f93c718ee219ea5 | [
"MIT"
] | 1 | 2021-11-19T19:39:36.000Z | 2021-11-19T19:39:36.000Z | runner/runs/doom_health_gathering.py | neevparikh/hierarchical-doom | 082f794b9c6101c4e94f15bf4f93c718ee219ea5 | [
"MIT"
] | null | null | null | runner/runs/doom_health_gathering.py | neevparikh/hierarchical-doom | 082f794b9c6101c4e94f15bf4f93c718ee219ea5 | [
"MIT"
] | null | null | null | from runner.run_description import RunDescription, Experiment, ParamGrid
_params = ParamGrid([
('seed', [1111, 2222, 3333, 4444, 5555]),
('env', ['doom_health_gathering_supreme']),
])
_experiments = [
Experiment(
'health_0_255',
'python -m algorithms.appo.train_appo --train_for_env_steps=4... | 49.454545 | 314 | 0.72886 | from runner.run_description import RunDescription, Experiment, ParamGrid
_params = ParamGrid([
('seed', [1111, 2222, 3333, 4444, 5555]),
('env', ['doom_health_gathering_supreme']),
])
_experiments = [
Experiment(
'health_0_255',
'python -m algorithms.appo.train_appo --train_for_env_steps=4... | true | true |
1c29ded6da989c2b282155c7263b3aeb9e616641 | 15,831 | py | Python | saleor/settings.py | fkoningy/saleor | 3850499d12f04df9312ba2975a63f7c23a26fc7e | [
"BSD-3-Clause"
] | 1 | 2018-07-15T18:52:31.000Z | 2018-07-15T18:52:31.000Z | saleor/settings.py | fkoningy/saleor | 3850499d12f04df9312ba2975a63f7c23a26fc7e | [
"BSD-3-Clause"
] | null | null | null | saleor/settings.py | fkoningy/saleor | 3850499d12f04df9312ba2975a63f7c23a26fc7e | [
"BSD-3-Clause"
] | null | null | null | import ast
import os.path
import dj_database_url
import dj_email_url
import django_cache_url
from django.contrib.messages import constants as messages
from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django_prices.templatetags.prices_i18n import get_currency_fraction
from . import __version_... | 30.859649 | 90 | 0.695345 | import ast
import os.path
import dj_database_url
import dj_email_url
import django_cache_url
from django.contrib.messages import constants as messages
from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django_prices.templatetags.prices_i18n import get_currency_fraction
from . import __version_... | true | true |
1c29df23e562889d50ca9875a5d56e09ffbb674a | 2,508 | py | Python | build/toolchain/gcc_ar_wrapper.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | build/toolchain/gcc_ar_wrapper.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | build/toolchain/gcc_ar_wrapper.py | metux/chromium-deb | 3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs the 'ar' command after removing its output file first.
This script is invoked like:
python gcc_ar_wrapper.py --ar=$AR --outp... | 31.746835 | 79 | 0.64673 |
import argparse
import os
import subprocess
import sys
import wrapper_utils
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--ar',
required=True,
help='The ar binary to run',
metavar='PATH')
parser.ad... | true | true |
1c29df515d8abb606b6c0a5afb126472d217f9c4 | 4,389 | py | Python | lite/examples/pose_estimation/raspberry_pi/tracker/keypoint_tracker.py | duy-maimanh/examples | 67ed12fd0adbe22469b6fac916d96e27f02a7330 | [
"Apache-2.0"
] | 6,484 | 2019-02-13T21:32:29.000Z | 2022-03-31T20:50:20.000Z | lite/examples/pose_estimation/raspberry_pi/tracker/keypoint_tracker.py | duy-maimanh/examples | 67ed12fd0adbe22469b6fac916d96e27f02a7330 | [
"Apache-2.0"
] | 288 | 2019-02-13T22:56:03.000Z | 2022-03-24T11:15:19.000Z | lite/examples/pose_estimation/raspberry_pi/tracker/keypoint_tracker.py | duy-maimanh/examples | 67ed12fd0adbe22469b6fac916d96e27f02a7330 | [
"Apache-2.0"
] | 7,222 | 2019-02-13T21:39:34.000Z | 2022-03-31T22:23:54.000Z | # Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.575 | 80 | 0.689907 |
import math
from typing import List
from data import Person
from tracker.tracker import Track
from tracker.tracker import Tracker
class KeypointTracker(Tracker):
def _compute_similarity(self, persons: List[Person]) -> List[List[float]]:
if (not persons) or (not self._tracks):
return [[]]
... | true | true |
1c29e017a9150e90604b8f3be18f10064bd7cf30 | 255 | py | Python | python_demos/src/language_demos/subprocess_popen.py | t4d-classes/python_10042021 | e2c28448ad66784c429655ab766f902b76d6ac79 | [
"MIT"
] | null | null | null | python_demos/src/language_demos/subprocess_popen.py | t4d-classes/python_10042021 | e2c28448ad66784c429655ab766f902b76d6ac79 | [
"MIT"
] | null | null | null | python_demos/src/language_demos/subprocess_popen.py | t4d-classes/python_10042021 | e2c28448ad66784c429655ab766f902b76d6ac79 | [
"MIT"
] | null | null | null | import subprocess
p = subprocess.Popen(
"where chkdsk.exe",
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
exit_code = p.wait()
print(exit_code)
if p and p.stdout:
for line in p.stdout.readlines():
print(str(line, "UTF-8"))
| 17 | 37 | 0.666667 | import subprocess
p = subprocess.Popen(
"where chkdsk.exe",
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
exit_code = p.wait()
print(exit_code)
if p and p.stdout:
for line in p.stdout.readlines():
print(str(line, "UTF-8"))
| true | true |
1c29e1c5552c2a0daba2b7fd6093aede48167a04 | 2,496 | py | Python | dream-team/app/models.py | dotronglong/python-examples | 22bf44a00196772e8dc8e2d0d426c843e51c89a7 | [
"MIT"
] | null | null | null | dream-team/app/models.py | dotronglong/python-examples | 22bf44a00196772e8dc8e2d0d426c843e51c89a7 | [
"MIT"
] | null | null | null | dream-team/app/models.py | dotronglong/python-examples | 22bf44a00196772e8dc8e2d0d426c843e51c89a7 | [
"MIT"
] | null | null | null | # app/models.py
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from app import db, login_manager
class Employee(UserMixin, db.Model):
"""
Create an Employee table
"""
# Ensures table will be named in plural and not in singular
# as is ... | 29.364706 | 74 | 0.648638 |
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from app import db, login_manager
class Employee(UserMixin, db.Model):
__tablename__ = 'employees'
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(60), index=T... | true | true |
1c29e37f5fb1565eefeb8516c30d660cbd0b2d0a | 699 | py | Python | SimpleCalculator.py | caofanCPU/PythonExperiment | 79b6e30160d5c60bfe035c63a1a46c5c1f4f638c | [
"MIT"
] | 1 | 2019-12-14T03:08:39.000Z | 2019-12-14T03:08:39.000Z | SimpleCalculator.py | caofanCPU/PythonExperiment | 79b6e30160d5c60bfe035c63a1a46c5c1f4f638c | [
"MIT"
] | null | null | null | SimpleCalculator.py | caofanCPU/PythonExperiment | 79b6e30160d5c60bfe035c63a1a46c5c1f4f638c | [
"MIT"
] | null | null | null | def add(a, b):
return a + b
def subtract(a, b):
return a - b
def multiply(a, b):
return a * b
def divide(a, b):
return a / b
print("Select Operation")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
choice = input("Enter Choice(1/2/3/4):")
num1 = int(input("Enter first ... | 17.475 | 53 | 0.575107 | def add(a, b):
return a + b
def subtract(a, b):
return a - b
def multiply(a, b):
return a * b
def divide(a, b):
return a / b
print("Select Operation")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
choice = input("Enter Choice(1/2/3/4):")
num1 = int(input("Enter first ... | true | true |
1c29e3c3debf06ead5eee9f442b9c7d3e6083f79 | 627 | py | Python | kansha/alembic/versions/b740362087_adding_max_cards.py | AnomalistDesignLLC/kansha | 85b5816da126b1c7098707c98f217d8b2e524ff2 | [
"BSD-3-Clause"
] | 161 | 2015-04-27T17:07:40.000Z | 2021-10-14T23:14:56.000Z | kansha/alembic/versions/b740362087_adding_max_cards.py | AnomalistDesignLLC/kansha | 85b5816da126b1c7098707c98f217d8b2e524ff2 | [
"BSD-3-Clause"
] | 228 | 2015-05-27T15:47:31.000Z | 2018-11-24T04:05:11.000Z | kansha/alembic/versions/b740362087_adding_max_cards.py | AnomalistDesignLLC/kansha | 85b5816da126b1c7098707c98f217d8b2e524ff2 | [
"BSD-3-Clause"
] | 38 | 2015-05-27T15:16:15.000Z | 2021-03-24T05:34:08.000Z | #--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
"""adding max cards
Revision ID: b740362087
Revises: 537fa16b46e7
Create Date: 2013-09-19 17:37:3... | 19.59375 | 66 | 0.728868 |
revision = 'b740362087'
down_revision = '537fa16b46e7'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('column', sa.Column('nb_max_cards', sa.Integer))
def downgrade():
op.drop_column('column', 'nb_max_cards')
| true | true |
1c29e63cd1f2269f8456618ea293f0ed38b6468f | 1,214 | py | Python | setup.py | geometry-labs/icon-sdk-python | e530df02eb16b394c3022d2d7d0383bd972e129a | [
"Apache-2.0"
] | null | null | null | setup.py | geometry-labs/icon-sdk-python | e530df02eb16b394c3022d2d7d0383bd972e129a | [
"Apache-2.0"
] | null | null | null | setup.py | geometry-labs/icon-sdk-python | e530df02eb16b394c3022d2d7d0383bd972e129a | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup, find_packages
with open(os.path.join('.', 'VERSION')) as version_file:
version = version_file.read().strip()
with open("README.md", 'r') as f:
long_description = f.read()
with open("requirements.txt") as requirements:
requires = list(requirements)
setup(
name=... | 33.722222 | 95 | 0.675453 | import os
from setuptools import setup, find_packages
with open(os.path.join('.', 'VERSION')) as version_file:
version = version_file.read().strip()
with open("README.md", 'r') as f:
long_description = f.read()
with open("requirements.txt") as requirements:
requires = list(requirements)
setup(
name=... | true | true |
1c29e69f21d2f5a6a3162e88fe6d1e6301b37aad | 2,094 | py | Python | Examples/J1J2/j1j2.py | vigsterkr/netket | 1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a | [
"Apache-2.0"
] | null | null | null | Examples/J1J2/j1j2.py | vigsterkr/netket | 1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a | [
"Apache-2.0"
] | null | null | null | Examples/J1J2/j1j2.py | vigsterkr/netket | 1e187ae2b9d2aa3f2e53b09fe743e50763d04c9a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Simons Foundation, 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 appli... | 27.194805 | 82 | 0.670487 |
import numpy as np
import netket as nk
sigmaz = np.array([[1, 0], [0, -1]])
mszsz = np.kron(sigmaz, sigmaz)
exchange = np.asarray([[0, 0, 0, 0], [0, 0, 2, 0], [0, 2, 0, 0], [0, 0, 0, 0]])
J = [1, 0.4]
L = 20
mats = []
sites = []
for i in range(L):
for d in [0, 1]:
mats.append... | true | true |
1c29e7b025dddb846ec8a127c08af1f681141a02 | 627 | py | Python | magnitude_list.py | hz37/JWG | 6e6d99803c368afc4af0fbc1e80fbc0138b3faf3 | [
"Unlicense"
] | null | null | null | magnitude_list.py | hz37/JWG | 6e6d99803c368afc4af0fbc1e80fbc0138b3faf3 | [
"Unlicense"
] | null | null | null | magnitude_list.py | hz37/JWG | 6e6d99803c368afc4af0fbc1e80fbc0138b3faf3 | [
"Unlicense"
] | null | null | null | #!/usr/local/bin/python3
# Magnitude tabel.
# Hens Zimmerman, 03-05-2016.
import math
import sys
if not sys.version_info >= (3,0):
print("Je hebt minstens python 3 nodig voor dit script")
exit()
# Vijfdemachts wortel van 100.
mag1_diff = pow(100, 1 / 5)
# Print tabel van magnitudes en hoe veel keer helder... | 25.08 | 67 | 0.684211 |
import math
import sys
if not sys.version_info >= (3,0):
print("Je hebt minstens python 3 nodig voor dit script")
exit()
mag1_diff = pow(100, 1 / 5)
for i in range (-5, 5):
print("Magnitude {0:>2}: {1:8.4f} x zo helder als magnitude 0".
format(i, 1 / pow(mag1_diff, i)))
| true | true |
1c29e80d74611e62a288f5e2f581f35e3c5d7c78 | 779 | py | Python | test/test_address.py | onfido/api-python-client | 9e05fcb1c1c511da74a822740a59a67057c50f03 | [
"MIT"
] | 11 | 2018-02-07T08:34:03.000Z | 2020-06-07T01:52:55.000Z | test/test_address.py | onfido/api-python-client | 9e05fcb1c1c511da74a822740a59a67057c50f03 | [
"MIT"
] | 5 | 2018-04-23T10:46:57.000Z | 2021-10-05T18:02:07.000Z | test/test_address.py | onfido/api-python-client | 9e05fcb1c1c511da74a822740a59a67057c50f03 | [
"MIT"
] | 15 | 2017-11-04T21:08:24.000Z | 2020-03-11T02:18:48.000Z | # coding: utf-8
"""
Onfido API
The Onfido API is used to submit check requests. # noqa: E501
The version of the OpenAPI document: 3.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import onfido
from onfido.models.address import Address ... | 19.475 | 79 | 0.668806 |
from __future__ import absolute_import
import unittest
import onfido
from onfido.models.address import Address
from onfido.rest import ApiException
class TestAddress(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testAddress(self):
s
if... | true | true |
1c29e8aa441efa2c3f2763d61ef78dcccba34c5c | 204 | py | Python | FUSS/tests/test_statistics.py | HeloiseS/FUSS | c7d5bbe6821eccb2a15d952a8899108098626474 | [
"MIT"
] | null | null | null | FUSS/tests/test_statistics.py | HeloiseS/FUSS | c7d5bbe6821eccb2a15d952a8899108098626474 | [
"MIT"
] | null | null | null | FUSS/tests/test_statistics.py | HeloiseS/FUSS | c7d5bbe6821eccb2a15d952a8899108098626474 | [
"MIT"
] | null | null | null | import FUSS.statistics as s
import numpy as np
def test_chi2():
x = np.arange(0,10,0.1)
y = x*2+5
y_r = np.array([0.1]*len(y))
chi = s.chi2(y, y_r, y+0.1)
assert int(chi) == 100
| 18.545455 | 32 | 0.558824 | import FUSS.statistics as s
import numpy as np
def test_chi2():
x = np.arange(0,10,0.1)
y = x*2+5
y_r = np.array([0.1]*len(y))
chi = s.chi2(y, y_r, y+0.1)
assert int(chi) == 100
| true | true |
1c29e92789716cdded437a16f600fe0081f668cb | 83 | py | Python | example/my/module/__main__.py | rmedaer/quickie | 85335cd4abf1ce1cf917e8a9ce2027a625abab14 | [
"Apache-2.0"
] | null | null | null | example/my/module/__main__.py | rmedaer/quickie | 85335cd4abf1ce1cf917e8a9ce2027a625abab14 | [
"Apache-2.0"
] | null | null | null | example/my/module/__main__.py | rmedaer/quickie | 85335cd4abf1ce1cf917e8a9ce2027a625abab14 | [
"Apache-2.0"
] | null | null | null |
if __name__ == '__main__':
print('Hello World')
print(__quickieconfig__)
| 13.833333 | 28 | 0.662651 |
if __name__ == '__main__':
print('Hello World')
print(__quickieconfig__)
| true | true |
1c29e99acddae8e25875cfbc51ed7fbd7b77459e | 1,066 | py | Python | tests/test_image.py | JoshKarpel/spiel | 9346e7212bab49a8b5963f5177f161b23c6e8ee8 | [
"MIT"
] | 3 | 2021-05-16T07:34:40.000Z | 2022-01-02T18:22:51.000Z | tests/test_image.py | JoshKarpel/spiel | 9346e7212bab49a8b5963f5177f161b23c6e8ee8 | [
"MIT"
] | 99 | 2021-03-29T14:35:37.000Z | 2022-03-21T22:11:04.000Z | tests/test_image.py | JoshKarpel/spiel | 9346e7212bab49a8b5963f5177f161b23c6e8ee8 | [
"MIT"
] | null | null | null | import pytest
from PIL import Image as Img
from rich.console import Console
from spiel.image import Image, ImageSize
from spiel.main import DEMO_DIR
@pytest.fixture
def image() -> Image:
return Image(Img.new(mode="RGB", size=ImageSize(100, 100)))
@pytest.mark.parametrize(
"max_width, height, size",
[
... | 25.380952 | 80 | 0.660413 | import pytest
from PIL import Image as Img
from rich.console import Console
from spiel.image import Image, ImageSize
from spiel.main import DEMO_DIR
@pytest.fixture
def image() -> Image:
return Image(Img.new(mode="RGB", size=ImageSize(100, 100)))
@pytest.mark.parametrize(
"max_width, height, size",
[
... | true | true |
1c29eb7104df68543f7f877a08ca1dc5f2322c6f | 48,611 | py | Python | la/flarry.py | mikiec84/la | 705e53df526ed316f5869962b50749f8d873364e | [
"BSD-2-Clause"
] | null | null | null | la/flarry.py | mikiec84/la | 705e53df526ed316f5869962b50749f8d873364e | [
"BSD-2-Clause"
] | null | null | null | la/flarry.py | mikiec84/la | 705e53df526ed316f5869962b50749f8d873364e | [
"BSD-2-Clause"
] | null | null | null | "Functions that operate on larrys."
import numpy as np
from la.deflarry import larry
from la.flabel import flattenlabel, listmap, listmap_fill
from la.farray import covMissing
from la.missing import missing_marker, ismissing
# Alignment -----------------------------------------------------------------
def align(la... | 32.493984 | 90 | 0.545041 | "Functions that operate on larrys."
import numpy as np
from la.deflarry import larry
from la.flabel import flattenlabel, listmap, listmap_fill
from la.farray import covMissing
from la.missing import missing_marker, ismissing
def align(lar1, lar2, join='inner', cast=True):
"""
Align two larrys using on... | false | true |
1c29eb8587c409c7faa4f14b0044a2f224472350 | 5,935 | py | Python | facetool/averager.py | hay/facetool | 3e296f7b177ebbcceb4b25f12f3327c3f6612f14 | [
"MIT"
] | 29 | 2018-12-10T22:40:07.000Z | 2022-03-30T02:56:28.000Z | facetool/averager.py | hay/facetool | 3e296f7b177ebbcceb4b25f12f3327c3f6612f14 | [
"MIT"
] | 2 | 2020-02-21T09:48:37.000Z | 2021-03-06T22:33:45.000Z | facetool/averager.py | hay/facetool | 3e296f7b177ebbcceb4b25f12f3327c3f6612f14 | [
"MIT"
] | 7 | 2019-08-09T09:19:12.000Z | 2022-03-30T02:56:27.000Z | # Based on the Face Averager by Satya Mallick
# < https://github.com/spmallick/learnopencv/blob/master/FaceAverage/faceAverage.py >
import cv2
import logging
import numpy as np
import pdb
from .faceaverage import similarityTransform, calculateDelaunayTriangles
from .faceaverage import constrainPoint, warpTriangle
from... | 31.737968 | 85 | 0.570514 |
import cv2
import logging
import numpy as np
import pdb
from .faceaverage import similarityTransform, calculateDelaunayTriangles
from .faceaverage import constrainPoint, warpTriangle
from .landmarks import Landmarks
from .path import Path
logger = logging.getLogger(__name__)
class Averager:
def __init__(
... | true | true |
1c29ebe96258e9703ea434ab29e480218c91a2d9 | 276,679 | py | Python | python/openlattice/api/edm_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | python/openlattice/api/edm_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | 1 | 2021-01-20T00:20:01.000Z | 2021-01-20T00:20:01.000Z | python/openlattice/api/edm_api.py | openlattice/api-clients | 1d5be9861785b295089b732f37464e31bf80c8ca | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenLattice API
OpenLattice API # noqa: E501
The version of the OpenAPI document: 0.0.1
Contact: support@openlattice.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility l... | 46.563278 | 205 | 0.602941 |
from __future__ import absolute_import
import re
import six
from openlattice.api_client import ApiClient
from openlattice.exceptions import (
ApiTypeError,
ApiValueError
)
class EdmApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiCli... | true | true |
1c29ec307da1bf6338dadd276ef8e81f4b935f8f | 892 | py | Python | app/test/article_test.py | Albert-Byrone/News-Bulletins | af424afd2ba5f06c43fc7f5947aa1cfaf1b3fb77 | [
"MIT"
] | null | null | null | app/test/article_test.py | Albert-Byrone/News-Bulletins | af424afd2ba5f06c43fc7f5947aa1cfaf1b3fb77 | [
"MIT"
] | null | null | null | app/test/article_test.py | Albert-Byrone/News-Bulletins | af424afd2ba5f06c43fc7f5947aa1cfaf1b3fb77 | [
"MIT"
] | null | null | null | import unittest
from ..models import Articles
# News = news.Article
class ArticleTest(unittest.TestCase):
'''
a class to test the behaviour of the Article class
'''
def setUp(self):
'''
a method that will run before any test
'''
self.new_article = Articles('Gizmodo.com',... | 38.782609 | 242 | 0.678251 | import unittest
from ..models import Articles
class ArticleTest(unittest.TestCase):
def setUp(self):
self.new_article = Articles('Gizmodo.com','Daniel Kolitz','What\'s Going to Happen With Bitcoin?','Since its inception in 2009, Bitcoin has made and ruined fortunes, helped sell fentanyl and books about cr... | true | true |
1c29ec6768265bef32bb470ce520f99763377d57 | 4,273 | py | Python | tests/core/commands/test_serialization.py | cyberhck/renku-python | 2e52dff9dd627c93764aadb9fd1e91bd190a5de7 | [
"Apache-2.0"
] | null | null | null | tests/core/commands/test_serialization.py | cyberhck/renku-python | 2e52dff9dd627c93764aadb9fd1e91bd190a5de7 | [
"Apache-2.0"
] | null | null | null | tests/core/commands/test_serialization.py | cyberhck/renku-python | 2e52dff9dd627c93764aadb9fd1e91bd190a5de7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2017-2019- Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | 31.189781 | 79 | 0.682659 |
import datetime
from urllib.parse import quote, urljoin
import yaml
from renku.core.management.client import LocalClient
from renku.core.models.datasets import Dataset
from renku.core.utils.doi import is_doi
def test_dataset_serialization(client, dataset, data_file):
def load_dataset(name):
... | true | true |
1c29ecbc6892e784e27c183a3588121404e155fe | 3,080 | py | Python | isucon/portal/internal/views.py | masaki-yamakawa/isucon9-portal | a3062d613d559aa9df5ac8d9aac2c774cf8a9419 | [
"MIT"
] | 2 | 2020-02-17T06:09:22.000Z | 2020-10-27T12:33:46.000Z | isucon/portal/internal/views.py | masaki-yamakawa/isucon9-portal | a3062d613d559aa9df5ac8d9aac2c774cf8a9419 | [
"MIT"
] | null | null | null | isucon/portal/internal/views.py | masaki-yamakawa/isucon9-portal | a3062d613d559aa9df5ac8d9aac2c774cf8a9419 | [
"MIT"
] | 1 | 2022-02-27T00:59:29.000Z | 2022-02-27T00:59:29.000Z | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from rest_framework import viewsets, status, serializers
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.routers import SimpleRouter
from rest_framework import excep... | 33.478261 | 95 | 0.690909 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from rest_framework import viewsets, status, serializers
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.routers import SimpleRouter
from rest_framework import excep... | true | true |
1c29ed5b84b07c25ce7ef105263e6f11e748c728 | 357 | py | Python | trackgenius/utilities/.ipynb_checkpoints/trackingnegomulti-checkpoint.py | SifanSong/trackgenius | 7a78350f16deb636b05eeb9ea667af581672775c | [
"MIT"
] | 1 | 2019-08-04T16:36:23.000Z | 2019-08-04T16:36:23.000Z | trackgenius/utilities/.ipynb_checkpoints/trackingnegomulti-checkpoint.py | SifanSong/trackgenius | 7a78350f16deb636b05eeb9ea667af581672775c | [
"MIT"
] | null | null | null | trackgenius/utilities/.ipynb_checkpoints/trackingnegomulti-checkpoint.py | SifanSong/trackgenius | 7a78350f16deb636b05eeb9ea667af581672775c | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
import os
import pandas as pd
import itertools
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
import time
import pylab as pl
from IPython import display
import sys
from trackgenius.utilities.background import Background
from trackgenius.trackingn... | 21 | 61 | 0.848739 | from __future__ import division
import numpy as np
import os
import pandas as pd
import itertools
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
import time
import pylab as pl
from IPython import display
import sys
from trackgenius.utilities.background import Background
from trackgenius.trackingn... | true | true |
1c29ed61e11ed17a02382317a662401be9c6bd26 | 4,893 | py | Python | src/data_loader.py | prataprudra2526/SimpleHTR-TF2.0 | 8530bb721c9a2e43a7c72f7b1cd13dc4f07ec6e0 | [
"MIT"
] | 1 | 2020-08-31T16:25:47.000Z | 2020-08-31T16:25:47.000Z | src/data_loader.py | prataprudra2526/SimpleHTR-TF2.0 | 8530bb721c9a2e43a7c72f7b1cd13dc4f07ec6e0 | [
"MIT"
] | null | null | null | src/data_loader.py | prataprudra2526/SimpleHTR-TF2.0 | 8530bb721c9a2e43a7c72f7b1cd13dc4f07ec6e0 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
import os
import random
import numpy as np
import cv2
from sample_preprocessor import pre_process
class Sample:
"sample from the dataset"
def __init__(self, gt_text, file_path):
self.gtText = gt_text
self.filePath = file_p... | 35.715328 | 120 | 0.61823 | from __future__ import division
from __future__ import print_function
import os
import random
import numpy as np
import cv2
from sample_preprocessor import pre_process
class Sample:
def __init__(self, gt_text, file_path):
self.gtText = gt_text
self.filePath = file_path
class Batch:
def __... | true | true |
1c29eeaa5aaef722b58feb69e384b381d0ef1b95 | 12,534 | py | Python | google/ads/google_ads/v3/proto/resources/shared_criterion_pb2.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/proto/resources/shared_criterion_pb2.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/proto/resources/shared_criterion_pb2.py | andy0937/google-ads-python | cb5da7f4a75076828d1fc3524b08cc167670435a | [
"Apache-2.0"
] | 1 | 2020-03-13T00:14:31.000Z | 2020-03-13T00:14:31.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v3/proto/resources/shared_criterion.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf im... | 62.049505 | 1,756 | 0.79783 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
1c29ef21fcdf69d978f6dccdc879632adb010f3d | 10,927 | py | Python | src/biokbase/narrative_method_store/client.py | pranjan77/narrative | 5714d199c7ca3d65cbfc1110b3d0641e250e62f9 | [
"MIT"
] | 2 | 2019-05-03T10:12:56.000Z | 2020-10-26T05:35:16.000Z | src/biokbase/narrative_method_store/client.py | pranjan77/narrative | 5714d199c7ca3d65cbfc1110b3d0641e250e62f9 | [
"MIT"
] | 220 | 2020-07-13T11:13:03.000Z | 2022-03-28T11:01:18.000Z | src/biokbase/narrative_method_store/client.py | pranjan77/narrative | 5714d199c7ca3d65cbfc1110b3d0641e250e62f9 | [
"MIT"
] | 2 | 2019-03-12T17:41:10.000Z | 2019-04-24T15:33:50.000Z | ############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
try:
import json as _json
except ImportError:
import sys
sys.path.append('simplejson-2.3.3')... | 36.062706 | 79 | 0.567951 | = url
self.timeout = int(timeout)
self._headers = dict()
self.trust_all_ssl_certificates = trust_all_ssl_certificates
# token overrides user_id and password
if token is not None:
self._headers['AUTHORIZATION'] = token
elif user_id is not None and password is n... | true | true |
1c29efc5dafd1ee8247020ffca5df0b74dfc16ca | 1,168 | py | Python | libcst/_parser/whitespace_parser.py | jschavesr/LibCST | e5ab7b90b4c9cd1f46e5b875ad317411abf48298 | [
"Apache-2.0"
] | 1 | 2022-02-10T10:59:22.000Z | 2022-02-10T10:59:22.000Z | libcst/_parser/whitespace_parser.py | jschavesr/LibCST | e5ab7b90b4c9cd1f46e5b875ad317411abf48298 | [
"Apache-2.0"
] | null | null | null | libcst/_parser/whitespace_parser.py | jschavesr/LibCST | e5ab7b90b4c9cd1f46e5b875ad317411abf48298 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Parso doesn't attempt to parse (or even emit tokens for) whitespace or comments that
aren't syntatically important. Instead, we're just ... | 38.933333 | 88 | 0.791952 |
try:
from libcst_native import whitespace_parser as mod
except ImportError:
from libcst._parser import py_whitespace_parser as mod
parse_simple_whitespace = mod.parse_simple_whitespace
parse_empty_lines = mod.parse_empty_lines
parse_trailing_whitespace = mod.parse_trailing_whitespace
parse... | true | true |
1c29f0b253669ad21db006e609bdf3fe1604e779 | 412 | py | Python | quad96/training/utility.py | ussamazahid96/quad96 | f30929342da4c44b1c05ce03a5b484be2eac7925 | [
"BSD-3-Clause"
] | 7 | 2020-12-21T14:03:02.000Z | 2021-10-04T18:53:54.000Z | quad96/training/utility.py | jedibobo/quad96 | f30929342da4c44b1c05ce03a5b484be2eac7925 | [
"BSD-3-Clause"
] | null | null | null | quad96/training/utility.py | jedibobo/quad96 | f30929342da4c44b1c05ce03a5b484be2eac7925 | [
"BSD-3-Clause"
] | 3 | 2021-01-31T09:15:47.000Z | 2021-09-18T13:22:54.000Z | #!/usr/bin/python
# -*- encoding=utf-8 -*-
# author: Ian
# e-mail: stmayue@gmail.com
# description:
# taken from https://github.com/Damcy/prioritized-experience-replay
def list_to_dict(in_list):
return dict((i, in_list[i]) for i in range(0, len(in_list)))
def exchange_key_value(in_dict):
return dict((in_di... | 17.166667 | 67 | 0.667476 |
def list_to_dict(in_list):
return dict((i, in_list[i]) for i in range(0, len(in_list)))
def exchange_key_value(in_dict):
return dict((in_dict[i], i) for i in in_dict)
def main():
pass
if __name__ == '__main__':
main()
| true | true |
1c29f1d1955ecf02359f0d03bfdb194a674ae1e5 | 1,696 | py | Python | tools/testrunner/local/variants.py | jizillon/v8 | 3276083a63efd0ff5cec29f7756226432880a22d | [
"BSD-3-Clause"
] | null | null | null | tools/testrunner/local/variants.py | jizillon/v8 | 3276083a63efd0ff5cec29f7756226432880a22d | [
"BSD-3-Clause"
] | null | null | null | tools/testrunner/local/variants.py | jizillon/v8 | 3276083a63efd0ff5cec29f7756226432880a22d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Use this to run several variants of the tests.
ALL_VARIANT_FLAGS = {
"code_serializer": [["--cache=code"]],
"default": [[]],
"future": [["--future"... | 32.615385 | 79 | 0.6875 |
ALL_VARIANT_FLAGS = {
"code_serializer": [["--cache=code"]],
"default": [[]],
"future": [["--future"]],
"infra_staging": [[]],
"liftoff": [["--liftoff"]],
"minor_mc": [["--minor-mc"]],
"nooptimization": [["--noopt"]],
"slow_path": [["--force-slow-path"]],
"stress": [["--stress-opt", "... | true | true |
1c29f20c97f33eed74f78fef23418862af10cd19 | 36 | py | Python | lib/python3.5/tokenize.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 1 | 2020-08-16T04:04:23.000Z | 2020-08-16T04:04:23.000Z | lib/python3.5/tokenize.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | 5 | 2020-06-05T18:53:24.000Z | 2021-12-13T19:49:15.000Z | lib/python3.5/tokenize.py | hwroitzsch/BikersLifeSaver | 469c738fdd6352c44a3f20689b17fa8ac04ad8a2 | [
"MIT"
] | null | null | null | /usr/local/lib/python3.5/tokenize.py | 36 | 36 | 0.805556 | /usr/local/lib/python3.5/tokenize.py | false | true |
1c29f2477853ced241cdf6fee6e3a2911e8e4eee | 700 | py | Python | problems/shock_tube_2phase_no_relax/plot.py | joshuahansel/cl1de | a6e641f6f6ffaa477a3a82ef40e013100577b61f | [
"MIT"
] | null | null | null | problems/shock_tube_2phase_no_relax/plot.py | joshuahansel/cl1de | a6e641f6f6ffaa477a3a82ef40e013100577b61f | [
"MIT"
] | null | null | null | problems/shock_tube_2phase_no_relax/plot.py | joshuahansel/cl1de | a6e641f6f6ffaa477a3a82ef40e013100577b61f | [
"MIT"
] | null | null | null | #!/usr/bin/python
from file_utilities import readCSVFile
from PlotterLine import PlotterLine
solution = readCSVFile("output.csv")
u_plotter = PlotterLine("Position", "Velocity [m/s]")
u_plotter.addSet(solution["x"], solution["u_liq"], "$u_\\ell$, Computed", color=1, linetype=2)
u_plotter.addSet(solution["x"], soluti... | 41.176471 | 106 | 0.72 |
from file_utilities import readCSVFile
from PlotterLine import PlotterLine
solution = readCSVFile("output.csv")
u_plotter = PlotterLine("Position", "Velocity [m/s]")
u_plotter.addSet(solution["x"], solution["u_liq"], "$u_\\ell$, Computed", color=1, linetype=2)
u_plotter.addSet(solution["x"], solution["u_vap"], "$u_... | true | true |
1c29f3dfdfe0f8be7fc49eeb1dd48e62b0e8cfa3 | 905 | py | Python | app/problem_register/serializers.py | 3ANov/spbauto_map | 3f1c3dcb5f370a9e04d5d496b18a3e6ab3dbe7a1 | [
"MIT"
] | null | null | null | app/problem_register/serializers.py | 3ANov/spbauto_map | 3f1c3dcb5f370a9e04d5d496b18a3e6ab3dbe7a1 | [
"MIT"
] | 17 | 2020-02-15T16:57:38.000Z | 2021-09-17T19:33:25.000Z | app/problem_register/serializers.py | 3ANov/spbauto_map | 3f1c3dcb5f370a9e04d5d496b18a3e6ab3dbe7a1 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from rest_framework_gis.serializers import GeoFeatureModelSerializer
from problem_register.models import ProblemStatus, ProblemLabel
class StatusSerializer(serializers.ModelSerializer):
class Meta:
model = ProblemStatus
fields = '__all__'
class ProblemLabe... | 29.193548 | 68 | 0.749171 | from rest_framework import serializers
from rest_framework_gis.serializers import GeoFeatureModelSerializer
from problem_register.models import ProblemStatus, ProblemLabel
class StatusSerializer(serializers.ModelSerializer):
class Meta:
model = ProblemStatus
fields = '__all__'
class ProblemLabe... | true | true |
1c29f3f8bf85436ddc83f5b606cd6dd158b4cc58 | 1,033 | py | Python | examples/DGL/mixhop.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | 1 | 2020-07-29T08:00:32.000Z | 2020-07-29T08:00:32.000Z | examples/DGL/mixhop.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | null | null | null | examples/DGL/mixhop.py | dongzizhu/GraphGallery | c65eab42daeb52de5019609fe7b368e30863b4ae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import torch
import dgl
import graphgallery
from graphgallery.datasets import Planetoid, NPZDataset
from graphgallery.gallery import callbacks
print("GraphGallery version: ", graphgallery.__version__)
print("PyTorch version: ", torch.__version__)
print("DGL version: ", dgl.__vers... | 33.322581 | 95 | 0.774443 |
import torch
import dgl
import graphgallery
from graphgallery.datasets import Planetoid, NPZDataset
from graphgallery.gallery import callbacks
print("GraphGallery version: ", graphgallery.__version__)
print("PyTorch version: ", torch.__version__)
print("DGL version: ", dgl.__version__)
data = NPZDataset('cora', ro... | true | true |
1c29f5a646b7d01aded9e848aa80a212c770cb90 | 133 | py | Python | src/jbdl/rbdl/utils/xyz2int.py | Wangxinhui-bot/jbdl | 4541fcbec9156c8a3dc496058230fdf2a3fa1bdf | [
"MIT"
] | null | null | null | src/jbdl/rbdl/utils/xyz2int.py | Wangxinhui-bot/jbdl | 4541fcbec9156c8a3dc496058230fdf2a3fa1bdf | [
"MIT"
] | null | null | null | src/jbdl/rbdl/utils/xyz2int.py | Wangxinhui-bot/jbdl | 4541fcbec9156c8a3dc496058230fdf2a3fa1bdf | [
"MIT"
] | null | null | null |
def xyz2int(jtype: str):
return tuple(['xyz'.index(s) for s in jtype])
if __name__ == '__main__':
print(xyz2int("xyzzz"))
| 16.625 | 49 | 0.631579 |
def xyz2int(jtype: str):
return tuple(['xyz'.index(s) for s in jtype])
if __name__ == '__main__':
print(xyz2int("xyzzz"))
| true | true |
1c29f68aebe5ab0e2200c9eb9b1971da09e03529 | 3,975 | py | Python | python/hw5/hw5.py | wladOSnull/first_jira | 250d4051e8b5a847b3524ec5a719a920cec775cc | [
"MIT"
] | null | null | null | python/hw5/hw5.py | wladOSnull/first_jira | 250d4051e8b5a847b3524ec5a719a920cec775cc | [
"MIT"
] | 1 | 2022-02-09T19:51:03.000Z | 2022-02-09T19:51:03.000Z | python/hw5/hw5.py | wladOSnull/first_jira | 250d4051e8b5a847b3524ec5a719a920cec775cc | [
"MIT"
] | null | null | null | import os, sys, sqlite3
### vars
##################################################
db_file1 = 'hw5_example.db'
db_file2 = 'demo.db'
db = os.path.join(os.path.dirname(__file__), db_file2)
conn = sqlite3.connect(db)
cur = conn.cursor()
serv_port = sys.argv[1]
serv_proj = sys.argv[2]
serv_name = sys.argv[3]
### funct... | 29.887218 | 89 | 0.611572 | import os, sys, sqlite3
| true | true |
1c29f6f6170652942e41e9e6f45ccbbf64d22b54 | 19,945 | py | Python | pysnmp/XYPLEX-LAT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/XYPLEX-LAT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/XYPLEX-LAT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module XYPLEX-LAT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XYPLEX-LAT-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:40:04 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | 123.881988 | 2,939 | 0.776335 |
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint = mibBuild... | true | true |
1c29f719a0251d41fb21d02b96ef5a1ef6d4b58c | 5,163 | py | Python | test/ensemble_test.py | 18756/ITMO_FS | d0465c61b15264812b3455194e8b9eea93b3f550 | [
"BSD-3-Clause"
] | null | null | null | test/ensemble_test.py | 18756/ITMO_FS | d0465c61b15264812b3455194e8b9eea93b3f550 | [
"BSD-3-Clause"
] | null | null | null | test/ensemble_test.py | 18756/ITMO_FS | d0465c61b15264812b3455194e8b9eea93b3f550 | [
"BSD-3-Clause"
] | null | null | null | import time
import unittest
import numpy as np
from collections import defaultdict
from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import f1_score
from sklearn.model_selection import KFold
from sklearn.svm import SVC
from ITMO_FS.ensembles.measure_based import *
from ITMO_FS.ens... | 41.637097 | 119 | 0.611079 | import time
import unittest
import numpy as np
from collections import defaultdict
from sklearn.datasets import make_classification, make_regression
from sklearn.metrics import f1_score
from sklearn.model_selection import KFold
from sklearn.svm import SVC
from ITMO_FS.ensembles.measure_based import *
from ITMO_FS.ens... | true | true |
1c29f7b3ae9833ae6122cd37ca3c253855d0d8c8 | 12,219 | py | Python | readthedocs/oauth/services/github.py | rshrc/readthedocs.org | 87079ef75948c3120bbe0bdb4528065af9623749 | [
"MIT"
] | null | null | null | readthedocs/oauth/services/github.py | rshrc/readthedocs.org | 87079ef75948c3120bbe0bdb4528065af9623749 | [
"MIT"
] | 1 | 2021-11-15T17:53:07.000Z | 2021-11-15T17:53:07.000Z | readthedocs/oauth/services/github.py | rshrc/readthedocs.org | 87079ef75948c3120bbe0bdb4528065af9623749 | [
"MIT"
] | null | null | null | """OAuth utility functions."""
import json
import logging
import re
from allauth.socialaccount.models import SocialToken
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
from django.conf import settings
from django.urls import reverse
from requests.exceptions import RequestException
from ... | 36.693694 | 87 | 0.544971 |
import json
import logging
import re
from allauth.socialaccount.models import SocialToken
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
from django.conf import settings
from django.urls import reverse
from requests.exceptions import RequestException
from readthedocs.api.v2.client impor... | true | true |
1c29f7fa6b33f5b3f1c0bdf9d4aa509f3eb3a9a2 | 17,216 | py | Python | lib/python2.7/site-packages/sklearn/linear_model/ransac.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | lib/python2.7/site-packages/sklearn/linear_model/ransac.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | lib/python2.7/site-packages/sklearn/linear_model/ransac.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | # coding: utf-8
# Author: Johannes Schönberger
#
# License: BSD 3 clause
import numpy as np
import warnings
from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone
from ..utils import check_random_state, check_array, check_consistent_length
from ..utils.random import sample_without_replacement
fr... | 38.172949 | 81 | 0.613848 |
import numpy as np
import warnings
from ..base import BaseEstimator, MetaEstimatorMixin, RegressorMixin, clone
from ..utils import check_random_state, check_array, check_consistent_length
from ..utils.random import sample_without_replacement
from ..utils.validation import check_is_fitted
from .base import Linear... | true | true |
1c29f80953de44cbaa05fa88d5dbd4cc8fa88e0f | 181 | py | Python | 0-easy/hex-to-decimal/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 21 | 2015-02-09T18:41:15.000Z | 2021-07-31T02:43:28.000Z | 0-easy/hex-to-decimal/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | null | null | null | 0-easy/hex-to-decimal/main.py | mpillar/codeeval | ad1fc5aea277575dcce6ad5db230d7a2bfe41eed | [
"Unlicense"
] | 37 | 2015-01-06T06:20:17.000Z | 2021-06-21T18:22:13.000Z | import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
test = test.strip()
if len(test) == 0:
continue
print(int(test, 16))
test_cases.close()
| 16.454545 | 35 | 0.61326 | import sys
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
test = test.strip()
if len(test) == 0:
continue
print(int(test, 16))
test_cases.close()
| true | true |
1c29f8204727648515a8adc54825a26ccad763ad | 75,085 | py | Python | src/kubernetes/client/apis/custom_objects_api.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 184 | 2017-12-20T21:50:06.000Z | 2022-03-19T13:24:58.000Z | src/kubernetes/client/apis/custom_objects_api.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 15 | 2018-01-17T17:30:51.000Z | 2021-12-16T14:25:09.000Z | src/kubernetes/client/apis/custom_objects_api.py | MarletteFunding/aws-kube-codesuite | ab4e5ce45416b83bffb947ab8d234df5437f4fca | [
"Apache-2.0"
] | 136 | 2018-01-09T22:52:06.000Z | 2022-02-24T13:26:18.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
im... | 53.365316 | 457 | 0.618326 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class CustomObjectsApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
... | true | true |
1c29f860bb7628c88ac43945ae3d49f7748e2f38 | 1,185 | py | Python | rebuild_tool/pkg_source_plugins/koji.py | mcyprian/deps_visualization | 064b36d49ce0b19b244d8853550bca1533ac8bea | [
"MIT"
] | 2 | 2016-01-22T11:08:06.000Z | 2016-06-02T13:11:41.000Z | rebuild_tool/pkg_source_plugins/koji.py | mcyprian/sclbuilder | 064b36d49ce0b19b244d8853550bca1533ac8bea | [
"MIT"
] | null | null | null | rebuild_tool/pkg_source_plugins/koji.py | mcyprian/sclbuilder | 064b36d49ce0b19b244d8853550bca1533ac8bea | [
"MIT"
] | null | null | null | from collections import UserDict
from rebuild_tool.pkg_source import set_class_attrs
from rebuild_tool.pkg_source_plugins.dnf import DnfArchive
from rebuild_tool.utils import ChangeDir, subprocess_popen_call
from rebuild_tool.exceptions import DownloadFailException
class PkgsContainer(UserDict):
@set_class_attrs
... | 34.852941 | 85 | 0.607595 | from collections import UserDict
from rebuild_tool.pkg_source import set_class_attrs
from rebuild_tool.pkg_source_plugins.dnf import DnfArchive
from rebuild_tool.utils import ChangeDir, subprocess_popen_call
from rebuild_tool.exceptions import DownloadFailException
class PkgsContainer(UserDict):
@set_class_attrs
... | true | true |
1c29f9396e9318272bc0071e6b26f44794a03282 | 10,471 | py | Python | pirates/effects/RavenFlock.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/effects/RavenFlock.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/effects/RavenFlock.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from EffectController import EffectController
from PooledEffect import PooledEffect
from pirates.piratesgui.GameOption... | 48.253456 | 295 | 0.681788 | from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from EffectController import EffectController
from PooledEffect import PooledEffect
from pirates.piratesgui.GameOption... | true | true |
1c29f9c284aec06036bcbaf940a869c103112745 | 12,749 | py | Python | src/cogs/loops/timeline.py | StephanAkkerman/FinTwit_Bot | 9f03ccc0edd02723e170f0e01e6edbe2bf14bc1f | [
"MIT"
] | null | null | null | src/cogs/loops/timeline.py | StephanAkkerman/FinTwit_Bot | 9f03ccc0edd02723e170f0e01e6edbe2bf14bc1f | [
"MIT"
] | 103 | 2021-12-16T15:00:53.000Z | 2022-03-31T18:13:53.000Z | src/cogs/loops/timeline.py | StephanAkkerman/FinTwit_Bot | 9f03ccc0edd02723e170f0e01e6edbe2bf14bc1f | [
"MIT"
] | 1 | 2022-03-19T15:29:11.000Z | 2022-03-19T15:29:11.000Z | ##> Imports
# > Standard libraries
from __future__ import annotations
import asyncio
from typing import List
import datetime
import traceback
# > 3rd Party Dependencies
from tweepy.asynchronous import AsyncStream
# > Discord dependencies
import discord
from discord.ext import commands
from discord.ext.tasks import lo... | 31.401478 | 105 | 0.563417 | uture__ import annotations
import asyncio
from typing import List
import datetime
import traceback
from tweepy.asynchronous import AsyncStream
import discord
from discord.ext import commands
from discord.ext.tasks import loop
from util.vars import (
config,
consumer_key,
consumer_secret,
access_to... | true | true |
1c29fadc085b465373443644c953b7cff17af96a | 1,175 | py | Python | examples/boilerplates/base_test_case.py | aoruilin/SeleniumBase | 304fd7a23661ebf561da47d4cd8f7365dba519ca | [
"MIT"
] | 1 | 2020-01-18T18:18:33.000Z | 2020-01-18T18:18:33.000Z | examples/boilerplates/base_test_case.py | aoruilin/SeleniumBase | 304fd7a23661ebf561da47d4cd8f7365dba519ca | [
"MIT"
] | 3 | 2021-03-31T19:32:57.000Z | 2021-12-13T20:33:50.000Z | examples/boilerplates/base_test_case.py | aoruilin/SeleniumBase | 304fd7a23661ebf561da47d4cd8f7365dba519ca | [
"MIT"
] | null | null | null | '''
You can use this as a boilerplate for your test framework.
Define your customized library methods in a master class like this.
Then have all your test classes inherit it.
BaseTestCase will inherit SeleniumBase methods from BaseCase.
'''
from seleniumbase import BaseCase
class BaseTestCase(BaseCase):
def set... | 26.704545 | 78 | 0.668085 |
from seleniumbase import BaseCase
class BaseTestCase(BaseCase):
def setUp(self):
super(BaseTestCase, self).setUp()
def tearDown(self):
self.save_teardown_screenshot()
super(BaseTestCase, self).tearDown()
def login(self):
pass... | true | true |
1c29faf41b0588bf4f95e68a438cb688e2285500 | 3,447 | py | Python | pyrf/_graveyard/randomize.py | WildMeOrg/wbia-tpl-pyrf | 3295c36c98f42f51264194efdb241ba9c8b29c5d | [
"Apache-2.0"
] | null | null | null | pyrf/_graveyard/randomize.py | WildMeOrg/wbia-tpl-pyrf | 3295c36c98f42f51264194efdb241ba9c8b29c5d | [
"Apache-2.0"
] | 1 | 2020-06-25T05:33:46.000Z | 2020-06-25T05:33:46.000Z | pyrf/_graveyard/randomize.py | WildbookOrg/wbia-tpl-pyrf | 3295c36c98f42f51264194efdb241ba9c8b29c5d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import random
from collections import defaultdict
import xml.etree.ElementTree as xml
# want to map a the filename -> all the animals present in the image
def parse_annotations(direct):
all_files = [
f
for f in os.listdir(direct)
if os.path.isfile(os.path.... | 36.284211 | 90 | 0.543081 |
import os
import random
from collections import defaultdict
import xml.etree.ElementTree as xml
def parse_annotations(direct):
all_files = [
f
for f in os.listdir(direct)
if os.path.isfile(os.path.join(direct, f)) and f.lower().endswith('.xml')
]
filenames = defaultdict(list)
... | true | true |
1c29fafc7779d6bacc8fcb3346fcd8458f4c7378 | 4,185 | py | Python | myapp/handlerz/postpage.py | GreenGiraffe1/ND_multi-user-blog | 2e04e8caddda60a142ac5e5ed97380fd419b988b | [
"MIT"
] | 1 | 2020-07-15T19:48:00.000Z | 2020-07-15T19:48:00.000Z | myapp/handlerz/postpage.py | GreenGiraffe1/ND_multi-user-blog | 2e04e8caddda60a142ac5e5ed97380fd419b988b | [
"MIT"
] | null | null | null | myapp/handlerz/postpage.py | GreenGiraffe1/ND_multi-user-blog | 2e04e8caddda60a142ac5e5ed97380fd419b988b | [
"MIT"
] | 1 | 2019-03-25T02:44:19.000Z | 2019-03-25T02:44:19.000Z | from handlerparent import Handler
from google.appengine.ext import db
from time import sleep
from myapp.modelz import Post, Comment, Likez
from myapp.functions.decorators import user_logged_in, post_exists
class PostPage(Handler):
"""Display individual posts with corresponding comments & 'Likes'."""
@post_e... | 44.052632 | 78 | 0.645639 | from handlerparent import Handler
from google.appengine.ext import db
from time import sleep
from myapp.modelz import Post, Comment, Likez
from myapp.functions.decorators import user_logged_in, post_exists
class PostPage(Handler):
@post_exists
def get(self, post_id):
key = db.Key.from_path(... | true | true |
1c29fbb811c49993249ffe833f785baaf72db3c2 | 746 | py | Python | ml2/data/encoder/encoder.py | reactive-systems/ml2 | c5ecaf07816b48a76ce4f7a3255fcf3baa78fd5c | [
"MIT"
] | 2 | 2021-06-30T14:00:11.000Z | 2022-02-02T14:12:26.000Z | ml2/data/encoder/encoder.py | reactive-systems/ml2 | c5ecaf07816b48a76ce4f7a3255fcf3baa78fd5c | [
"MIT"
] | null | null | null | ml2/data/encoder/encoder.py | reactive-systems/ml2 | c5ecaf07816b48a76ce4f7a3255fcf3baa78fd5c | [
"MIT"
] | 1 | 2021-07-01T13:38:33.000Z | 2021-07-01T13:38:33.000Z | """Abstract encoder class"""
START_TOKEN = '<s>'
EOS_TOKEN = '<e>'
PAD_TOKEN = '<p>'
class Encoder():
def __init__(self):
self.tokens = None
self.ids = None
self.error = None
def tokenize(self):
raise NotImplementedError
def detokenize(self):
raise NotImplemente... | 19.631579 | 42 | 0.651475 |
START_TOKEN = '<s>'
EOS_TOKEN = '<e>'
PAD_TOKEN = '<p>'
class Encoder():
def __init__(self):
self.tokens = None
self.ids = None
self.error = None
def tokenize(self):
raise NotImplementedError
def detokenize(self):
raise NotImplementedError
def encode(self, ... | true | true |
1c29fd00b41fbee8665ef18532564efaa580753d | 1,274 | py | Python | Desafios/desafio-102.py | marielitonmb/Curso-Python3 | 26215c47c4d1eadf940b8024305b7e9ff600883b | [
"MIT"
] | null | null | null | Desafios/desafio-102.py | marielitonmb/Curso-Python3 | 26215c47c4d1eadf940b8024305b7e9ff600883b | [
"MIT"
] | null | null | null | Desafios/desafio-102.py | marielitonmb/Curso-Python3 | 26215c47c4d1eadf940b8024305b7e9ff600883b | [
"MIT"
] | null | null | null | # Aula 21 - Desafio 102: Funçao para fatorial
# Criar uma funçao chamada fatorial() que receba dois paramentros.
# O primeiro indica o numero a ser calculado e o outro chamado 'show',
# sera o valor logico (opcional) indicando se sera mostrado ou nao
# na tela o processo de calculo do fatorial.
# Obs: adicionar um docs... | 26 | 72 | 0.535322 |
def fatorial(num=1, show=False):
from math import factorial
if show:
c = num
f = 1
print(f'{num}! = ', end='')
while c > 0:
print(f'{c} ', end='')
print('x ' if c > 1 else '= ', end='')
f *= c
c -= 1
print(f)
else... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.