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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c38e33ae64f835b0c8934e37fcf8d2d6100be58 | 2,677 | py | Python | scripts/import_csr_eeg.py | yhc29/eegdb | 3c81921a549018aa0d669c77cd400640c2ca1c72 | [
"MIT"
] | null | null | null | scripts/import_csr_eeg.py | yhc29/eegdb | 3c81921a549018aa0d669c77cd400640c2ca1c72 | [
"MIT"
] | null | null | null | scripts/import_csr_eeg.py | yhc29/eegdb | 3c81921a549018aa0d669c77cd400640c2ca1c72 | [
"MIT"
] | null | null | null | import sys
sys.path.insert(0, '..')
import os
import random
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from multiprocessing.pool import ThreadPool
import csv
from Utils.timer import Timer
from Eegdb.data_file import DataFile
from Eegdb.eegdb import Eegdb
import config.... | 35.223684 | 164 | 0.714606 | import sys
sys.path.insert(0, '..')
import os
import random
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from multiprocessing.pool import ThreadPool
import csv
from Utils.timer import Timer
from Eegdb.data_file import DataFile
from Eegdb.eegdb import Eegdb
import config.... | true | true |
1c38e3923e3af9aa9fd3756c54ad05ccca71ff75 | 855 | py | Python | cmsc-135/assignment-4/stadium_seating.py | joeypsmith/mc-projects | 7082988f46036c336b37de25747cec69593156e3 | [
"MIT"
] | null | null | null | cmsc-135/assignment-4/stadium_seating.py | joeypsmith/mc-projects | 7082988f46036c336b37de25747cec69593156e3 | [
"MIT"
] | null | null | null | cmsc-135/assignment-4/stadium_seating.py | joeypsmith/mc-projects | 7082988f46036c336b37de25747cec69593156e3 | [
"MIT"
] | null | null | null | #CMSC-135 Assignment 4: Stadium Seating
#Programmer: Joseph Smith
#Date: 3/2/2021
#Cost of each seat
A_COST = 20
B_COST = 15
C_COST = 10
#Number of each seat
aSeats = int(input("Enter count of A seats: "))
bSeats = int(input("Enter count of B seats: "))
cSeats = int(input("Enter count of C seats: "))
#Calculate inco... | 24.428571 | 60 | 0.670175 |
A_COST = 20
B_COST = 15
C_COST = 10
aSeats = int(input("Enter count of A seats: "))
bSeats = int(input("Enter count of B seats: "))
cSeats = int(input("Enter count of C seats: "))
aIncome = float(aSeats * A_COST)
bIncome = float(bSeats * B_COST)
cIncome = float(cSeats * C_COST)
def ShowIncome(a, b, c):
... | true | true |
1c38e393375be2e446618bdba6d55688060891ab | 661 | py | Python | examples/natel.py | romilly/reggie-dsl | cefe02acebcc3147bd976f91473a1e0e85ed7dac | [
"MIT"
] | 1 | 2018-11-22T04:29:14.000Z | 2018-11-22T04:29:14.000Z | examples/natel.py | romilly/reggie-dsl | cefe02acebcc3147bd976f91473a1e0e85ed7dac | [
"MIT"
] | 1 | 2018-11-22T04:41:13.000Z | 2018-11-22T04:41:13.000Z | examples/natel.py | romilly/reggie-dsl | cefe02acebcc3147bd976f91473a1e0e85ed7dac | [
"MIT"
] | null | null | null | from reggie.core import *
d3 = multiple(digit, 3)
d4 = d3 + digit
international = name(optional(escape('+1')),'i')
area = optional(osp + lp + name(d3,'area') + rp)
local = osp + name(d3,'exchange') + dash + name(d4,'number')
number = international + area + local
def convert(text, area_default='123'):
matched = m... | 27.541667 | 61 | 0.635401 | from reggie.core import *
d3 = multiple(digit, 3)
d4 = d3 + digit
international = name(optional(escape('+1')),'i')
area = optional(osp + lp + name(d3,'area') + rp)
local = osp + name(d3,'exchange') + dash + name(d4,'number')
number = international + area + local
def convert(text, area_default='123'):
matched = m... | true | true |
1c38e54775ed5406e58b4f38865c4df2653ca4a2 | 678 | py | Python | engine/client.py | aryaman0098/Record-Fetcher | 93090e4eff40b7854a28cb603eb0c0eab2fc6e47 | [
"MIT"
] | null | null | null | engine/client.py | aryaman0098/Record-Fetcher | 93090e4eff40b7854a28cb603eb0c0eab2fc6e47 | [
"MIT"
] | null | null | null | engine/client.py | aryaman0098/Record-Fetcher | 93090e4eff40b7854a28cb603eb0c0eab2fc6e47 | [
"MIT"
] | null | null | null | import sys
from socket import *
from protocol import *
name=sys.argv[1]
lang=sys.argv[2]
email=sys.argv[3]
phone=sys.argv[4]
academic=sys.argv[5]
other=sys.argv[6]
auth=sys.argv[7]
d={'name':name,'lang':lang,'email':email,'phone':phone,'academic':academic,'other':other,'auth':auth}
for key in ['email','phone','... | 19.941176 | 101 | 0.696165 | import sys
from socket import *
from protocol import *
name=sys.argv[1]
lang=sys.argv[2]
email=sys.argv[3]
phone=sys.argv[4]
academic=sys.argv[5]
other=sys.argv[6]
auth=sys.argv[7]
d={'name':name,'lang':lang,'email':email,'phone':phone,'academic':academic,'other':other,'auth':auth}
for key in ['email','phone','... | true | true |
1c38e5c18e7249d59ec2dcd4084f1605730cbcc5 | 5,298 | py | Python | kubernetes/client/models/v1_rolling_update_daemon_set.py | pllsxyc/python | 442ebc019056c2dc246be94f85cf61f1e1d26a88 | [
"Apache-2.0"
] | 1 | 2019-10-07T13:54:36.000Z | 2019-10-07T13:54:36.000Z | kubernetes/client/models/v1_rolling_update_daemon_set.py | pllsxyc/python | 442ebc019056c2dc246be94f85cf61f1e1d26a88 | [
"Apache-2.0"
] | 8 | 2020-10-28T01:18:36.000Z | 2021-06-11T01:06:15.000Z | kubernetes/client/models/v1_rolling_update_daemon_set.py | pllsxyc/python | 442ebc019056c2dc246be94f85cf61f1e1d26a88 | [
"Apache-2.0"
] | 1 | 2021-03-16T16:05:33.000Z | 2021-03-16T16:05:33.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.16
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 43.073171 | 852 | 0.662325 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1RollingUpdateDaemonSet(object):
openapi_types = {
'max_unavailable': 'object'
}
attribute_map = {
'max_unavailable': 'maxUnavailable'
}
def __init__(self, max_unavailable... | true | true |
1c38e71cf958ba8ee81d66f247f0a559745b91bb | 181 | py | Python | bin/linkEntropy.py | mikiec84/linkshop | 72959ceca0003be226edeca6496f915502831596 | [
"Apache-2.0"
] | 6 | 2017-07-18T15:28:33.000Z | 2020-03-03T14:45:45.000Z | bin/linkEntropy.py | mikiec84/linkshop | 72959ceca0003be226edeca6496f915502831596 | [
"Apache-2.0"
] | null | null | null | bin/linkEntropy.py | mikiec84/linkshop | 72959ceca0003be226edeca6496f915502831596 | [
"Apache-2.0"
] | 3 | 2017-09-09T00:36:48.000Z | 2020-03-03T14:45:49.000Z | #!/usr/bin/env python3
"""Command-line wrapper for stats.cli_linkEntropy."""
import loadPath # Adds the project path.
import linkograph.stats
linkograph.stats.cli_linkEntropy()
| 20.111111 | 53 | 0.773481 |
import loadPath
import linkograph.stats
linkograph.stats.cli_linkEntropy()
| true | true |
1c38e7231d5c77c8bf1ca323c8fc43dd65c74f84 | 3,594 | py | Python | lib/wrapper/faster_rcnn_wrapper.py | nikolaevra/tf-faster-rcnn | 4a5a5f9cfd4dc6548ee9cf63f1122eadbc06ea39 | [
"MIT"
] | null | null | null | lib/wrapper/faster_rcnn_wrapper.py | nikolaevra/tf-faster-rcnn | 4a5a5f9cfd4dc6548ee9cf63f1122eadbc06ea39 | [
"MIT"
] | null | null | null | lib/wrapper/faster_rcnn_wrapper.py | nikolaevra/tf-faster-rcnn | 4a5a5f9cfd4dc6548ee9cf63f1122eadbc06ea39 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import os
import tensorflow as tf
from model.config import cfg
from model.test import im_detect
from nets.resnet_v1 import resnetv1
from nets.vgg16 import vgg16
from utils.timer import Timer
CLASSE... | 30.717949 | 94 | 0.584864 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import os
import tensorflow as tf
from model.config import cfg
from model.test import im_detect
from nets.resnet_v1 import resnetv1
from nets.vgg16 import vgg16
from utils.timer import Timer
CLASSE... | true | true |
1c38e83de610ddff4d22683d51874fa737b54bfb | 65,385 | py | Python | plotly/graph_objs/streamtube/_colorbar.py | paulamool/plotly.py | 6121ac1f324e247e4e4b2964d65d7393377777c0 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/graph_objs/streamtube/_colorbar.py | paulamool/plotly.py | 6121ac1f324e247e4e4b2964d65d7393377777c0 | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/graph_objs/streamtube/_colorbar.py | skeptycal/plotly.py | 2e5bf6e2f7c213295c405ece3e859f4d3f8030d1 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class ColorBar(BaseTraceHierarchyType):
# bgcolor
# -------
@property
def bgcolor(self):
"""
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex str... | 36.815878 | 96 | 0.566323 | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class ColorBar(BaseTraceHierarchyType):
@property
def bgcolor(self):
return self['bgcolor']
@bgcolor.setter
def bgcolor(self, val):
self['bgcolor'] = val
@property
def bordercolor(self):
... | true | true |
1c38e8ca4141892217c904caf65e694fc01e78c1 | 1,325 | py | Python | premailer/cache.py | rdhyee/premailer | bdbb8c263cba5fd5d59bc1690e11a93b15cb9b74 | [
"BSD-3-Clause"
] | 692 | 2015-01-02T19:33:21.000Z | 2022-03-16T09:48:11.000Z | premailer/cache.py | rdhyee/premailer | bdbb8c263cba5fd5d59bc1690e11a93b15cb9b74 | [
"BSD-3-Clause"
] | 161 | 2015-01-01T21:16:21.000Z | 2022-03-20T22:03:58.000Z | premailer/cache.py | rdhyee/premailer | bdbb8c263cba5fd5d59bc1690e11a93b15cb9b74 | [
"BSD-3-Clause"
] | 110 | 2015-01-29T20:37:13.000Z | 2022-03-31T01:08:31.000Z | import functools
import os
import threading
import cachetools
# Available cache options.
CACHE_IMPLEMENTATIONS = {
"LFU": cachetools.LFUCache,
"LRU": cachetools.LRUCache,
"TTL": cachetools.TTLCache,
}
# Time to live (seconds) for entries in TTL cache. Defaults to 1 hour.
TTL_CACHE_TIMEOUT = 1 * 60 * 60
... | 25.480769 | 84 | 0.70717 | import functools
import os
import threading
import cachetools
CACHE_IMPLEMENTATIONS = {
"LFU": cachetools.LFUCache,
"LRU": cachetools.LRUCache,
"TTL": cachetools.TTLCache,
}
TTL_CACHE_TIMEOUT = 1 * 60 * 60
DEFAULT_CACHE_MAXSIZE = 128
cache_access_lock = threading.RLock()
cache_type = os.environ.g... | true | true |
1c38e915f9c1112c51ad32183021cebfb0c7561d | 1,395 | py | Python | firmware/xu4Mqtt/skyCamReaderWithSave.py | mi3nts/centralHub | 92aab9510fff4331b7363cd1272b5779ccf167a1 | [
"CC-BY-3.0"
] | null | null | null | firmware/xu4Mqtt/skyCamReaderWithSave.py | mi3nts/centralHub | 92aab9510fff4331b7363cd1272b5779ccf167a1 | [
"CC-BY-3.0"
] | 6 | 2020-01-10T20:58:20.000Z | 2020-01-10T21:46:54.000Z | firmware/xu4Mqtt/skyCamReaderWithSave.py | mi3nts/centralHub | 92aab9510fff4331b7363cd1272b5779ccf167a1 | [
"CC-BY-3.0"
] | 4 | 2020-04-22T22:59:34.000Z | 2021-04-29T17:33:34.000Z | from datetime import timezone
import time
import os
import datetime
import numpy as np
import pickle
from skimage import io, color
import cv2
from mintsXU4 import mintsSkyCamReader as mSCR
from mintsXU4 import mintsSensorReader as mSR
from mintsXU4 import mintsDefinitions as mD
dataFolder = mD.dataFolder
def main(... | 29.0625 | 125 | 0.731183 | from datetime import timezone
import time
import os
import datetime
import numpy as np
import pickle
from skimage import io, color
import cv2
from mintsXU4 import mintsSkyCamReader as mSCR
from mintsXU4 import mintsSensorReader as mSR
from mintsXU4 import mintsDefinitions as mD
dataFolder = mD.dataFolder
def main(... | true | true |
1c38e94d2cddaf16dd7ce6167cdfa3d68a7f55d7 | 1,101 | py | Python | GANS/MicroGan_2/sample/Discriminator.py | cmoimoro/gym-micropolis-ga | d105da7c624670083fc1d6e3acf265511d9e2df6 | [
"MIT"
] | null | null | null | GANS/MicroGan_2/sample/Discriminator.py | cmoimoro/gym-micropolis-ga | d105da7c624670083fc1d6e3acf265511d9e2df6 | [
"MIT"
] | null | null | null | GANS/MicroGan_2/sample/Discriminator.py | cmoimoro/gym-micropolis-ga | d105da7c624670083fc1d6e3acf265511d9e2df6 | [
"MIT"
] | null | null | null | from settings import *
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, ngpu):
super(Discriminator, self).__init__()
self.ngpu = ngpu
self.main = nn.Sequential(
# input is (nc) x 64 x 64
nn.Conv2d(nc, ndf, 4, 2, 1, bias=False),
nn.... | 36.7 | 61 | 0.504087 | from settings import *
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, ngpu):
super(Discriminator, self).__init__()
self.ngpu = ngpu
self.main = nn.Sequential(
nn.Conv2d(nc, ndf, 4, 2, 1, bias=False),
nn.LeakyReLU(0.2, inplace=Tr... | true | true |
1c38eab8d70edab703890f91450fbf31b1951120 | 3,035 | py | Python | bot/main.py | xXebicXx/amog-bot | 1e924ca51a67d2dee6d149686fcee2d1da9bec81 | [
"MIT"
] | null | null | null | bot/main.py | xXebicXx/amog-bot | 1e924ca51a67d2dee6d149686fcee2d1da9bec81 | [
"MIT"
] | null | null | null | bot/main.py | xXebicXx/amog-bot | 1e924ca51a67d2dee6d149686fcee2d1da9bec81 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from asyncio import sleep
import os
import random
from discord.utils import get
thingtowatch = random.randint(1,5)
if thingtowatch == 1:
movie = "Among Us: The Movie"
elif thingtowatch == 2:
movie = "pornography"
elif thingtowatch == 3:
movie = "Uncle Dane"
elif ... | 27.098214 | 104 | 0.683031 | import discord
from discord.ext import commands
from asyncio import sleep
import os
import random
from discord.utils import get
thingtowatch = random.randint(1,5)
if thingtowatch == 1:
movie = "Among Us: The Movie"
elif thingtowatch == 2:
movie = "pornography"
elif thingtowatch == 3:
movie = "Uncle Dane"
elif ... | true | true |
1c38eb6f905bfc3975686a29e979a88645590ddc | 6,967 | py | Python | playbooks/robusta_playbooks/daemonsets.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 273 | 2021-12-28T20:48:48.000Z | 2022-03-31T16:03:13.000Z | playbooks/robusta_playbooks/daemonsets.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 103 | 2022-01-10T11:45:47.000Z | 2022-03-31T16:31:11.000Z | playbooks/robusta_playbooks/daemonsets.py | pavangudiwada/robusta | cc1cb8a2e198f404e275a3947cf64e9f700f56f4 | [
"MIT"
] | 35 | 2021-12-30T15:30:14.000Z | 2022-03-28T11:43:57.000Z | import logging
from robusta.api import *
@action
def daemonset_fix_config(event: ExecutionBaseEvent):
finding = Finding(
title="Proposed fix",
source=FindingSource.CALLBACK.value,
aggregation_key="daemonset_fix_config",
)
finding.add_enrichment(
[
MarkdownBlock... | 32.70892 | 126 | 0.591072 | import logging
from robusta.api import *
@action
def daemonset_fix_config(event: ExecutionBaseEvent):
finding = Finding(
title="Proposed fix",
source=FindingSource.CALLBACK.value,
aggregation_key="daemonset_fix_config",
)
finding.add_enrichment(
[
MarkdownBlock... | true | true |
1c38ec052b5ddea8487aba11a06c53ea793be859 | 14,396 | py | Python | src/cloudant/view.py | ssshah5/clone-python-cloudant | 1939f6ffe1b36fd87e94e984fe300e4e109d2171 | [
"Apache-2.0"
] | 1 | 2017-01-22T21:42:20.000Z | 2017-01-22T21:42:20.000Z | venv/lib/python3.5/site-packages/cloudant/view.py | remkohdev/python-flask-d3js-newssentiment | 006e1083b6a307fda55b176eadb810aa08bd8b63 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.5/site-packages/cloudant/view.py | remkohdev/python-flask-d3js-newssentiment | 006e1083b6a307fda55b176eadb810aa08bd8b63 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015 IBM. 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 ... | 37.295337 | 81 | 0.633996 |
import contextlib
import posixpath
from ._2to3 import STRTYPE
from ._common_util import codify, get_docs
from .result import Result
from .error import CloudantArgumentError, CloudantException
class View(dict):
def __init__(
self,
ddoc,
view_name,
map_f... | true | true |
1c38ec0726481b170f31d8e8aa55c5f50b3a5b24 | 418 | py | Python | scico/test/osver.py | lanl/scico | 976c9e5833f8f67eed2eaa43460d89fb09bb9f78 | [
"BSD-3-Clause"
] | 18 | 2021-09-21T18:55:11.000Z | 2022-03-21T20:13:05.000Z | scico/test/osver.py | lanl/scico | 976c9e5833f8f67eed2eaa43460d89fb09bb9f78 | [
"BSD-3-Clause"
] | 218 | 2021-09-21T21:45:08.000Z | 2022-03-30T18:45:27.000Z | scico/test/osver.py | lanl/scico | 976c9e5833f8f67eed2eaa43460d89fb09bb9f78 | [
"BSD-3-Clause"
] | 2 | 2021-09-23T22:44:47.000Z | 2021-12-18T16:01:43.000Z | import platform
from packaging.version import parse
def osx_ver_geq_than(verstr):
"""Determine relative platform OSX version.
Determine whether platform has OSX version that is as recent as or
more recent than verstr. Returns ``False`` if the OS is not OSX.
"""
if platform.system() != "Darwin":
... | 26.125 | 70 | 0.69378 | import platform
from packaging.version import parse
def osx_ver_geq_than(verstr):
if platform.system() != "Darwin":
return False
osxver = platform.mac_ver()[0]
return parse(osxver) >= parse(verstr)
| true | true |
1c38ec844d9bc6690a842eedede54bb33740e663 | 1,682 | py | Python | doks/rst/code.py | rec/doks | 8fb1c2779bb40cbae9427c3be357231543e89d54 | [
"MIT"
] | 1 | 2020-10-31T03:25:23.000Z | 2020-10-31T03:25:23.000Z | doks/rst/code.py | rec/doks | 8fb1c2779bb40cbae9427c3be357231543e89d54 | [
"MIT"
] | 15 | 2020-05-29T11:50:13.000Z | 2020-12-08T11:07:45.000Z | doks/rst/code.py | rec/doks | 8fb1c2779bb40cbae9427c3be357231543e89d54 | [
"MIT"
] | null | null | null | from pathlib import Path
import configparser
import inspect
import os
MSG = '`{msg} <https://{host}/{user}/{project}/{sep}/{file}#L{begin}-L{end}>`_'
SEPARATORS = {
'github.com': 'blob/master',
'gitlab.com': '-/blob/master',
}
SECTIONS = '-=~_+*#`\':<>^"'
_GIT_SUFFIX = '.git'
_SSH_PREFIX = 'git@'
_HTTPS_PREFI... | 25.484848 | 79 | 0.550535 | from pathlib import Path
import configparser
import inspect
import os
MSG = '`{msg} <https://{host}/{user}/{project}/{sep}/{file}#L{begin}-L{end}>`_'
SEPARATORS = {
'github.com': 'blob/master',
'gitlab.com': '-/blob/master',
}
SECTIONS = '-=~_+*#`\':<>^"'
_GIT_SUFFIX = '.git'
_SSH_PREFIX = 'git@'
_HTTPS_PREFI... | true | true |
1c38f095c0a6cd3ff807c4e382e8d14fc253b7e3 | 258 | py | Python | 1038.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | 1 | 2020-10-01T14:22:48.000Z | 2020-10-01T14:22:48.000Z | 1038.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | null | null | null | 1038.py | gabriel1lima/Questoes---URI---Python | 4e88d76cf7ea68baf0464071bc4f72ced7d746cd | [
"MIT"
] | 7 | 2020-10-01T13:03:22.000Z | 2020-10-02T16:10:25.000Z | a, b = input().split()
a = int(a)
b = int(b)
if(a == 1):
qtd = b * 4.00
elif(a == 2):
qtd = b * 4.50
elif(a == 3):
qtd = b * 5.00
elif(a == 4):
qtd = b * 2.00
elif(a == 5):
qtd = b * 1.50
print("Total: R$ {0:.2f}".format(qtd)) | 9.923077 | 38 | 0.418605 | a, b = input().split()
a = int(a)
b = int(b)
if(a == 1):
qtd = b * 4.00
elif(a == 2):
qtd = b * 4.50
elif(a == 3):
qtd = b * 5.00
elif(a == 4):
qtd = b * 2.00
elif(a == 5):
qtd = b * 1.50
print("Total: R$ {0:.2f}".format(qtd)) | true | true |
1c38f098ac5ea01177bd2eda8edb782f78560e5d | 1,161 | py | Python | meta-scripts/build_tmp_sequence_import_sql.py | jrnold/census-postgres | 62242aa19c3b0125d9136aedaf9691468feddeb2 | [
"MIT"
] | 1 | 2019-09-07T23:37:51.000Z | 2019-09-07T23:37:51.000Z | meta-scripts/build_tmp_sequence_import_sql.py | jrnold/census-postgres | 62242aa19c3b0125d9136aedaf9691468feddeb2 | [
"MIT"
] | null | null | null | meta-scripts/build_tmp_sequence_import_sql.py | jrnold/census-postgres | 62242aa19c3b0125d9136aedaf9691468feddeb2 | [
"MIT"
] | 1 | 2019-09-07T23:37:58.000Z | 2019-09-07T23:37:58.000Z | #!/bin/python
import sys
import os
from os.path import join
def run(data_root, working_dir, release, config):
sql_file = open("%s/import_sequences.sql" % working_dir, 'w')
estimate_sequences = []
moe_sequences = []
for root, dirs, files in os.walk(data_root):
files.sort()
for fname... | 30.552632 | 110 | 0.611542 |
import sys
import os
from os.path import join
def run(data_root, working_dir, release, config):
sql_file = open("%s/import_sequences.sql" % working_dir, 'w')
estimate_sequences = []
moe_sequences = []
for root, dirs, files in os.walk(data_root):
files.sort()
for fname in files:
... | false | true |
1c38f0c0b4f51f9242a1fdcf3df4f3244bb65964 | 431 | py | Python | client/upload.py | Shadey/3dsMouse | c485182d29da706f4b51ade3c63a5e7710bef8fc | [
"Unlicense"
] | null | null | null | client/upload.py | Shadey/3dsMouse | c485182d29da706f4b51ade3c63a5e7710bef8fc | [
"Unlicense"
] | null | null | null | client/upload.py | Shadey/3dsMouse | c485182d29da706f4b51ade3c63a5e7710bef8fc | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
from ftplib import FTP
from glob import glob as files
import os
host = "192.168.0.18"
port = 5000
rootname = os.getcwd().split("/")[-1]
f = FTP()
f.connect(host,port=port)
try:
f.cwd("3ds/"+rootname)
except:
f.mkd("3ds/"+rootname)
for match in files(rootname+"*"):
print("Sending",match)
... | 21.55 | 42 | 0.647332 |
from ftplib import FTP
from glob import glob as files
import os
host = "192.168.0.18"
port = 5000
rootname = os.getcwd().split("/")[-1]
f = FTP()
f.connect(host,port=port)
try:
f.cwd("3ds/"+rootname)
except:
f.mkd("3ds/"+rootname)
for match in files(rootname+"*"):
print("Sending",match)
with open(match... | true | true |
1c38f22e6c7d5e5f1997fb0e2b0250ba88cd41b7 | 7,494 | py | Python | recbole/model/general_recommender/recvae.py | Ahren09/RecBole | b3921818dfbc1b81f9eda8d5e9f05bc9d9114089 | [
"MIT"
] | 1,773 | 2020-11-04T01:22:11.000Z | 2022-03-31T08:05:41.000Z | recbole/model/general_recommender/recvae.py | chenyushuo/RecBole | f04084b8d2cffcb79eb9e4b21325f8f6c75c638e | [
"MIT"
] | 378 | 2020-11-05T02:42:27.000Z | 2022-03-31T22:57:04.000Z | recbole/model/general_recommender/recvae.py | chenyushuo/RecBole | f04084b8d2cffcb79eb9e4b21325f8f6c75c638e | [
"MIT"
] | 354 | 2020-11-04T01:37:09.000Z | 2022-03-31T10:39:32.000Z | # -*- coding: utf-8 -*-
# @Time : 2021/2/28
# @Author : Lanling Xu
# @Email : xulanling_sherry@163.com
r"""
RecVAE
################################################
Reference:
Shenbin, Ilya, et al. "RecVAE: A new variational autoencoder for Top-N recommendations with implicit feedback." In WSDM 2020.
Reference ... | 36.202899 | 129 | 0.659995 |
import numpy as np
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
from recbole.model.abstract_recommender import GeneralRecommender
from recbole.model.init import xavier_normal_initialization
from recbole.utils import InputType
def swish(x):
return x.mul(torch... | true | true |
1c38f295aae119c477441d6ff368dfdc82f6fb32 | 1,560 | py | Python | setup.py | mardiros/creds | d442a05e4213d7ed335b13b5873cca834d0be4c3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mardiros/creds | d442a05e4213d7ed335b13b5873cca834d0be4c3 | [
"BSD-3-Clause"
] | null | null | null | setup.py | mardiros/creds | d442a05e4213d7ed335b13b5873cca834d0be4c3 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
from setuptools import setup, find_packages
py_version = sys.version_info[:2]
if py_version < (3, 3):
raise Exception("websockets requires Python >= 3.3.")
here = os.path.abspath(os.path.dirname(__file__))
NAME = 'creds'
with open(os.path.join(here, 'README.rst')) as readme:
README = re... | 25.57377 | 63 | 0.60641 | import os
import sys
from setuptools import setup, find_packages
py_version = sys.version_info[:2]
if py_version < (3, 3):
raise Exception("websockets requires Python >= 3.3.")
here = os.path.abspath(os.path.dirname(__file__))
NAME = 'creds'
with open(os.path.join(here, 'README.rst')) as readme:
README = re... | true | true |
1c38f34f72256a64a2c7d5472579ad0c3de7e838 | 19,346 | py | Python | panels/options.py | skinny121/MCEdit-TallWorlds | e43fe889fde0ce41652ab77d7887a2a680846312 | [
"0BSD"
] | 5 | 2015-05-18T06:22:54.000Z | 2020-08-04T08:27:02.000Z | panels/options.py | skinny121/MCEdit-TallWorlds | e43fe889fde0ce41652ab77d7887a2a680846312 | [
"0BSD"
] | null | null | null | panels/options.py | skinny121/MCEdit-TallWorlds | e43fe889fde0ce41652ab77d7887a2a680846312 | [
"0BSD"
] | null | null | null | import albow
from albow.dialogs import Dialog
from config import config
import pygame
from albow.translate import _, buildTemplate
import sys
import os
import logging
import traceback
import directories
old_lang = None
old_fprop = None
class OptionsPanel(Dialog):
anchor = 'wh'
def __init__(self, mcedit):
... | 47.650246 | 163 | 0.563734 | import albow
from albow.dialogs import Dialog
from config import config
import pygame
from albow.translate import _, buildTemplate
import sys
import os
import logging
import traceback
import directories
old_lang = None
old_fprop = None
class OptionsPanel(Dialog):
anchor = 'wh'
def __init__(self, mcedit):
... | false | true |
1c38f463f37b5e3bc7741adb703b39a8e662b295 | 26,825 | py | Python | tools/pg_bloat_check.py | payals/pgtreats | 4aef2730f831886b2d48a39d9f5e8d9cee07178f | [
"PostgreSQL"
] | 86 | 2015-02-18T17:53:23.000Z | 2022-03-31T05:22:18.000Z | tools/pg_bloat_check.py | payals/pgtreats | 4aef2730f831886b2d48a39d9f5e8d9cee07178f | [
"PostgreSQL"
] | 2 | 2016-03-29T14:26:43.000Z | 2017-07-25T19:58:24.000Z | tools/pg_bloat_check.py | payals/pgtreats | 4aef2730f831886b2d48a39d9f5e8d9cee07178f | [
"PostgreSQL"
] | 39 | 2015-01-26T13:10:25.000Z | 2021-11-20T15:11:01.000Z | #!/usr/bin/env python
# Script is maintained at https://github.com/keithf4/pg_bloat_check
import argparse, csv, json, psycopg2, sys
from psycopg2 import extras
version = "2.1.1"
parser = argparse.ArgumentParser(description="Provide a bloat report for PostgreSQL tables and/or indexes. This script uses the pgstattupl... | 52.087379 | 701 | 0.586692 |
import argparse, csv, json, psycopg2, sys
from psycopg2 import extras
version = "2.1.1"
parser = argparse.ArgumentParser(description="Provide a bloat report for PostgreSQL tables and/or indexes. This script uses the pgstattuple contrib module which must be installed first. Note that the query to check for bloat c... | true | true |
1c38f4d7f27db7ee57691713ddffe76cb71264a9 | 6,279 | py | Python | Bots/Python/Skills/CodeFirst/WaterfallSkillBot/dialogs/activity_router_dialog.py | gabog/BotFramework-FunctionalTests | 9ebd811539648bf7d53f6f92af42ff8ef60344a1 | [
"MIT"
] | 1 | 2021-07-06T14:29:26.000Z | 2021-07-06T14:29:26.000Z | Bots/Python/Skills/CodeFirst/WaterfallSkillBot/dialogs/activity_router_dialog.py | gabog/BotFramework-FunctionalTests | 9ebd811539648bf7d53f6f92af42ff8ef60344a1 | [
"MIT"
] | 1 | 2021-04-23T14:54:34.000Z | 2021-04-23T19:56:22.000Z | Bots/Python/Skills/CodeFirst/WaterfallSkillBot/dialogs/activity_router_dialog.py | GiulianoDolceTalianoSantoro/BotFramework-FunctionalTests | f21bded918cf9e51a296fcb0b87ad6495c59bea8 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
from typing import Dict
from datetime import datetime
from botbuilder.core import MessageFactory, ConversationState
from botbuilder.dialogs import (
WaterfallDialog,
WaterfallStepContext,
DialogTurnRe... | 37.598802 | 99 | 0.697723 |
import json
from typing import Dict
from datetime import datetime
from botbuilder.core import MessageFactory, ConversationState
from botbuilder.dialogs import (
WaterfallDialog,
WaterfallStepContext,
DialogTurnResult,
DialogTurnStatus,
ComponentDialog,
)
from botbuilder.dialogs.skills import (
... | true | true |
1c38f55a2049f9d2130eac35f1bf089857d791f8 | 144 | py | Python | fondo_api/templatetags/env_var.py | Fonmon/Fondo-API | 0c78eaab259df18219c01fceb67bd1b6ff8ec941 | [
"MIT"
] | null | null | null | fondo_api/templatetags/env_var.py | Fonmon/Fondo-API | 0c78eaab259df18219c01fceb67bd1b6ff8ec941 | [
"MIT"
] | 48 | 2018-01-13T14:52:52.000Z | 2022-03-13T17:41:42.000Z | fondo_api/templatetags/env_var.py | Fonmon/Fondo-API | 0c78eaab259df18219c01fceb67bd1b6ff8ec941 | [
"MIT"
] | null | null | null | import os
from django import template
register = template.Library()
@register.simple_tag
def host():
return os.environ.get('HOST_URL_APP') | 18 | 41 | 0.763889 | import os
from django import template
register = template.Library()
@register.simple_tag
def host():
return os.environ.get('HOST_URL_APP') | true | true |
1c38f55ce8ecf3a5a54085f7c982ef92d79f5983 | 87 | py | Python | tutors/apps.py | JCorn64/QT-Study-App | f7c02878f0cf15e99d0a07c1a9d1b3cda745e77e | [
"PostgreSQL",
"Unlicense"
] | 7 | 2021-01-17T23:10:15.000Z | 2021-02-01T21:35:36.000Z | main/tutors/apps.py | DiveshTheReal/studentutor | 0d3ef57887bde4dd2ee40d68015598f9c8052ffd | [
"MIT"
] | 7 | 2021-01-17T15:10:47.000Z | 2022-03-12T00:53:49.000Z | tutors/apps.py | JCorn64/QT-Study-App | f7c02878f0cf15e99d0a07c1a9d1b3cda745e77e | [
"PostgreSQL",
"Unlicense"
] | 3 | 2021-01-18T09:36:16.000Z | 2021-01-20T16:29:40.000Z | from django.apps import AppConfig
class TutorsConfig(AppConfig):
name = 'tutors'
| 14.5 | 33 | 0.747126 | from django.apps import AppConfig
class TutorsConfig(AppConfig):
name = 'tutors'
| true | true |
1c38f596a128f5b5e06f64318ca590e1a20a4d12 | 4,934 | py | Python | pydataproc/clusters.py | oli-hall/py-dataproc | c931f01731e451accb63b2f37d9b9f36d73b36b5 | [
"MIT"
] | 1 | 2017-11-03T11:11:25.000Z | 2017-11-03T11:11:25.000Z | pydataproc/clusters.py | oli-hall/py-dataproc | c931f01731e451accb63b2f37d9b9f36d73b36b5 | [
"MIT"
] | null | null | null | pydataproc/clusters.py | oli-hall/py-dataproc | c931f01731e451accb63b2f37d9b9f36d73b36b5 | [
"MIT"
] | null | null | null | import time
from googleapiclient.errors import HttpError
from pydataproc.cluster import Cluster
from pydataproc.logger import log
from pydataproc.errors import ClusterAlreadyExistsException
class Clusters(object):
def __init__(self, dataproc):
assert dataproc
self.dataproc = dataproc
def ... | 39.472 | 103 | 0.597892 | import time
from googleapiclient.errors import HttpError
from pydataproc.cluster import Cluster
from pydataproc.logger import log
from pydataproc.errors import ClusterAlreadyExistsException
class Clusters(object):
def __init__(self, dataproc):
assert dataproc
self.dataproc = dataproc
def ... | true | true |
1c38f6066920b707f5006a22c318e9355d2e4728 | 3,591 | py | Python | code/setup.py | amarallab/waldo | e38d23d9474a0bcb7a94e685545edb0115b12af4 | [
"MIT"
] | null | null | null | code/setup.py | amarallab/waldo | e38d23d9474a0bcb7a94e685545edb0115b12af4 | [
"MIT"
] | null | null | null | code/setup.py | amarallab/waldo | e38d23d9474a0bcb7a94e685545edb0115b12af4 | [
"MIT"
] | null | null | null | import os
import glob
from distutils.core import setup
import sys
import py2exe
import matplotlib
import FileDialog
import multiworm
HERE = os.path.dirname(os.path.abspath(__file__))
def find_data_files(source, target, patterns):
if glob.has_magic(source) or glob.has_magic(target):
raise ... | 44.8875 | 129 | 0.416319 | import os
import glob
from distutils.core import setup
import sys
import py2exe
import matplotlib
import FileDialog
import multiworm
HERE = os.path.dirname(os.path.abspath(__file__))
def find_data_files(source, target, patterns):
if glob.has_magic(source) or glob.has_magic(target):
raise ... | true | true |
1c38f7d107393081787ef9e7d849ab1e3d091575 | 18,433 | py | Python | .history/implementations/pixelda/pixelda_try_20190106200556.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | .history/implementations/pixelda/pixelda_try_20190106200556.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | .history/implementations/pixelda/pixelda_try_20190106200556.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... | 39.219149 | 145 | 0.646287 | import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... | true | true |
1c38f7d66d8033d83bf82c562dbcd4589affb0e4 | 14,608 | py | Python | AppServer/google/appengine/api/urlfetch.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/google/appengine/api/urlfetch.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/google/appengine/api/urlfetch.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 31.619048 | 80 | 0.701533 |
"""URL downloading API.
Methods defined in this module:
Fetch(): fetchs a given URL using an HTTP request using on of the methods
GET, POST, HEAD, PUT, DELETE or PATCH request
"""
import httplib
import os
import StringIO
import threading
import UserDict
import urllib2
import... | false | true |
1c38f90544ad7f9caa50911d9ab401d1222696e5 | 748 | py | Python | aqi_data_crawler/aqi/pipelines.py | firest547/firest547.github.io | aef008faef4d7a37a5696cd2c52e84d48773d097 | [
"MIT"
] | null | null | null | aqi_data_crawler/aqi/pipelines.py | firest547/firest547.github.io | aef008faef4d7a37a5696cd2c52e84d48773d097 | [
"MIT"
] | 1 | 2020-12-08T21:26:28.000Z | 2020-12-08T21:26:28.000Z | aqi_data_crawler/aqi/pipelines.py | firest547/firest547.github.io | aef008faef4d7a37a5696cd2c52e84d48773d097 | [
"MIT"
] | 2 | 2020-12-08T21:10:15.000Z | 2021-01-27T01:26:20.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to t he ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.pipelines.files import FilesPipeline
import os
import pathlib
import re
import subprocess
class AQIPipeline(Fi... | 27.703704 | 66 | 0.640374 |
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from scrapy.pipelines.files import FilesPipeline
import os
import pathlib
import re
import subprocess
class AQIPipeline(FilesPipeline):
def process_item(self, item, spider):
url = item["file_urls"][-1]
file_name = re.split(r'... | true | true |
1c38f9b6834b5e89da2e65143cfac40c9a8f8555 | 525 | py | Python | Recursion2/Conclusion/largest_rectangle.py | mamoudmatook/Leetcode | 59fb1612ee648a9b99ff7cc779ada5656c01ecd2 | [
"MIT"
] | null | null | null | Recursion2/Conclusion/largest_rectangle.py | mamoudmatook/Leetcode | 59fb1612ee648a9b99ff7cc779ada5656c01ecd2 | [
"MIT"
] | null | null | null | Recursion2/Conclusion/largest_rectangle.py | mamoudmatook/Leetcode | 59fb1612ee648a9b99ff7cc779ada5656c01ecd2 | [
"MIT"
] | null | null | null | class Solution:
def largestRectangleArea(self, heights: List[int]) -> int:
def rec(start, end):
if start > end:
return 0
min_idx = start
for i in range(start, end + 1):
if heights[min_idx] > heights[i]:
min_idx = i
... | 35 | 62 | 0.447619 | class Solution:
def largestRectangleArea(self, heights: List[int]) -> int:
def rec(start, end):
if start > end:
return 0
min_idx = start
for i in range(start, end + 1):
if heights[min_idx] > heights[i]:
min_idx = i
... | true | true |
1c38fa1649a2f3ffec8b11017b75e247c0ba37f2 | 11,051 | py | Python | app/gameimpl/x01_match.py | jtessier-cit/soft8023-darts | 51fb480b4c21a0cf49ffe1ef6e8e30855aee744e | [
"MIT"
] | null | null | null | app/gameimpl/x01_match.py | jtessier-cit/soft8023-darts | 51fb480b4c21a0cf49ffe1ef6e8e30855aee744e | [
"MIT"
] | null | null | null | app/gameimpl/x01_match.py | jtessier-cit/soft8023-darts | 51fb480b4c21a0cf49ffe1ef6e8e30855aee744e | [
"MIT"
] | null | null | null | import json
import pika as pika
from service.match_service import MatchVisitTemplate
from service.match_service import MatchManager
# Lab 03 add MatchStatus
from datatype.enums import DartMultiplier, MatchStatus
# CHECKOUTS = {
# 170: "T20 T20 Bull",
# 167: "T20 T19 Bull",
# 164: "T20 T18 Bull",
# 16... | 32.218659 | 119 | 0.56936 | import json
import pika as pika
from service.match_service import MatchVisitTemplate
from service.match_service import MatchManager
from datatype.enums import DartMultiplier, MatchStatus
CHECKOUTS = {
2: "D1",
3: "1 D1",
4: "D2",
5: "3 D1",
6: "D3",
7: "5 D1",
8: "D4",
9:... | true | true |
1c38fb26366ef519e4f9e2c34379dc99e196f4c0 | 5,752 | py | Python | spond/experimental/openimage/test/test_cooccurrence.py | rekcahpassyla/spond | 8282a4f40bd145243f0e37b8542f0f30b16b96f9 | [
"Apache-2.0"
] | 1 | 2021-02-12T19:08:25.000Z | 2021-02-12T19:08:25.000Z | spond/experimental/openimage/test/test_cooccurrence.py | rekcahpassyla/spond | 8282a4f40bd145243f0e37b8542f0f30b16b96f9 | [
"Apache-2.0"
] | 8 | 2020-09-29T12:36:14.000Z | 2021-02-18T16:25:03.000Z | spond/experimental/openimage/test/test_cooccurrence.py | rekcahpassyla/spond | 8282a4f40bd145243f0e37b8542f0f30b16b96f9 | [
"Apache-2.0"
] | 5 | 2020-09-28T06:55:30.000Z | 2021-01-06T14:21:16.000Z | import os
import unittest
import torch
from spond.experimental.openimage import readfile
class TestProcessing(unittest.TestCase):
def setUp(self):
self.rootdir = "."
# image metadata file, contains image labels
self.imgfn = "test-image-labels.csv"
# labels metadata file, contains... | 44.246154 | 90 | 0.573713 | import os
import unittest
import torch
from spond.experimental.openimage import readfile
class TestProcessing(unittest.TestCase):
def setUp(self):
self.rootdir = "."
self.imgfn = "test-image-labels.csv"
self.labelsfn = "test-labels.csv"
self.datafn = "t... | true | true |
1c38fbc4fcfc4b3815961329dd7b42ba0e0af30a | 3,892 | py | Python | python3/koans/about_iteration.py | Buraisx/python_koans | de12cdfcf6bfb53b1d4d05dc5e567c53963607fe | [
"MIT"
] | null | null | null | python3/koans/about_iteration.py | Buraisx/python_koans | de12cdfcf6bfb53b1d4d05dc5e567c53963607fe | [
"MIT"
] | null | null | null | python3/koans/about_iteration.py | Buraisx/python_koans | de12cdfcf6bfb53b1d4d05dc5e567c53963607fe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1,6))
total = 0
for num in it:
total += num
self.assertEqual(15 , total)
def test_iterating_with_next(self):... | 28.202899 | 77 | 0.536485 |
from runner.koan import *
class AboutIteration(Koan):
def test_iterators_are_a_type(self):
it = iter(range(1,6))
total = 0
for num in it:
total += num
self.assertEqual(15 , total)
def test_iterating_with_next(self):
stages = iter(['alpha','beta','gamm... | true | true |
1c38fc8f7c0c371003b969b2014fe5096eb2f9fd | 333 | py | Python | normflow/simple_flow_model.py | mbaddar1/normalizing-flows | d1409464a65234354b29ed9ea0ede2d12100440c | [
"MIT"
] | null | null | null | normflow/simple_flow_model.py | mbaddar1/normalizing-flows | d1409464a65234354b29ed9ea0ede2d12100440c | [
"MIT"
] | null | null | null | normflow/simple_flow_model.py | mbaddar1/normalizing-flows | d1409464a65234354b29ed9ea0ede2d12100440c | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch
class SimpleFlowModel(nn.Module):
def __init__(self, flows):
super().__init__()
self.flows = nn.ModuleList(flows)
def forward(self, z):
ld = 0.
for flow in self.flows:
z, ld_ = flow(z)
ld += ld_
r... | 20.8125 | 42 | 0.522523 | import torch.nn as nn
import torch
class SimpleFlowModel(nn.Module):
def __init__(self, flows):
super().__init__()
self.flows = nn.ModuleList(flows)
def forward(self, z):
ld = 0.
for flow in self.flows:
z, ld_ = flow(z)
ld += ld_
r... | true | true |
1c38fdbc199692b0e9f4a403726624c0ee8ac914 | 476 | py | Python | apps/wallet/migrations/0009_auto_20200707_1324.py | ecoo-app/ecoo-backend | ffe54abcd2e8c1a18ef2fa992c45a10f8232a4a0 | [
"MIT"
] | 1 | 2021-03-31T18:25:44.000Z | 2021-03-31T18:25:44.000Z | apps/wallet/migrations/0009_auto_20200707_1324.py | ecoo-app/ecoo-backend | ffe54abcd2e8c1a18ef2fa992c45a10f8232a4a0 | [
"MIT"
] | null | null | null | apps/wallet/migrations/0009_auto_20200707_1324.py | ecoo-app/ecoo-backend | ffe54abcd2e8c1a18ef2fa992c45a10f8232a4a0 | [
"MIT"
] | 1 | 2021-01-14T09:27:42.000Z | 2021-01-14T09:27:42.000Z | # Generated by Django 2.2.13 on 2020-07-07 13:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wallet", "0008_auto_20200625_1546"),
]
operations = [
migrations.AlterField(
model_name="wallet",
name="state",
... | 22.666667 | 87 | 0.554622 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wallet", "0008_auto_20200625_1546"),
]
operations = [
migrations.AlterField(
model_name="wallet",
name="state",
field=models.IntegerField(
... | true | true |
1c38fe8d107ec09d3d5e7b582b79068ac3df3f61 | 18,926 | py | Python | aiodropbox/aiodropbox/utils/__init__.py | bossjones/sandbox | 9ae6a01576d42ff2616f38bad0df2c6d73afe91f | [
"MIT"
] | 4 | 2022-02-23T11:03:32.000Z | 2022-03-07T20:01:42.000Z | aiodropbox/aiodropbox/utils/__init__.py | bossjones/sandbox | 9ae6a01576d42ff2616f38bad0df2c6d73afe91f | [
"MIT"
] | null | null | null | aiodropbox/aiodropbox/utils/__init__.py | bossjones/sandbox | 9ae6a01576d42ff2616f38bad0df2c6d73afe91f | [
"MIT"
] | 1 | 2022-02-23T11:03:32.000Z | 2022-02-23T11:03:32.000Z | # NOTE: Via Red https://github.com/Cog-Creators/Red-DiscordBot/tree/V3/develop/redbot
from __future__ import annotations
import asyncio
from asyncio import Semaphore, as_completed
from asyncio.futures import isfuture
from inspect import isawaitable as _isawaitable, signature as _signature
from itertools import chain
i... | 29.251932 | 170 | 0.601765 |
from __future__ import annotations
import asyncio
from asyncio import Semaphore, as_completed
from asyncio.futures import isfuture
from inspect import isawaitable as _isawaitable, signature as _signature
from itertools import chain
import json
import logging
from pathlib import Path
from typing import (
Any,
... | true | true |
1c38fff85fd13310d28ad936b660726bf37a0a86 | 1,510 | py | Python | docs/source/conf.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 16 | 2021-10-13T21:00:11.000Z | 2022-03-21T11:12:09.000Z | docs/source/conf.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 49 | 2021-10-19T13:18:51.000Z | 2022-03-30T08:20:17.000Z | docs/source/conf.py | Dlubal-Software/RFEM_Python_Client | 9e29c598dadf380d49677c463931f0be659ccc40 | [
"MIT"
] | 7 | 2021-10-13T06:06:24.000Z | 2022-03-29T17:48:39.000Z | import os
import sys
sys.path.insert(0, os.path.abspath('..\RFEM'))
# -- Project information -----------------------------------------------------
project = 'RFEM/RSTAB Webservices'
copyright = '2022, Dlubal Software'
author = 'Dlubal Software'
# The full version, including alpha/beta/rc tags
release = '1.0.2'
# S... | 25.59322 | 86 | 0.691391 | import os
import sys
sys.path.insert(0, os.path.abspath('..\RFEM'))
project = 'RFEM/RSTAB Webservices'
copyright = '2022, Dlubal Software'
author = 'Dlubal Software'
release = '1.0.2'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx_autodoc_typehints']
templates_path = ['_templates']
exc... | true | true |
1c39007f27f05eeab87f9f4f74dadb32c2d358d9 | 2,433 | py | Python | runtime/translation/models/gnmt_large/gpus=4/stage1.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | runtime/translation/models/gnmt_large/gpus=4/stage1.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | runtime/translation/models/gnmt_large/gpus=4/stage1.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
from seq2seq.models.decoder import RecurrentAttention
class Stage1(torch.nn.Module):
def __init__(self):
super(Stage1, self).__init__()
self.layer10 = torch.nn.Embedding(32320, 1024, padding_idx=0)
... | 36.863636 | 93 | 0.560625 |
import torch
from seq2seq.models.decoder import RecurrentAttention
class Stage1(torch.nn.Module):
def __init__(self):
super(Stage1, self).__init__()
self.layer10 = torch.nn.Embedding(32320, 1024, padding_idx=0)
self.layer12 = torch.nn.Dropout(p=0.2)
self.layer13 = torch.... | true | true |
1c390119a9c7cccdc60788e81648e86dbe5b1433 | 3,592 | py | Python | lib/detect/utils/json_utils_test.py | nhattruongpham/ALPR_SSD_CTPN_LPRNet | b20bf84f1ecc56252da37c25d08a0b7d7e10477c | [
"MIT"
] | null | null | null | lib/detect/utils/json_utils_test.py | nhattruongpham/ALPR_SSD_CTPN_LPRNet | b20bf84f1ecc56252da37c25d08a0b7d7e10477c | [
"MIT"
] | null | null | null | lib/detect/utils/json_utils_test.py | nhattruongpham/ALPR_SSD_CTPN_LPRNet | b20bf84f1ecc56252da37c25d08a0b7d7e10477c | [
"MIT"
] | null | null | null | # Copyright 2017 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.653061 | 80 | 0.657016 |
import os
import tensorflow as tf
from retail_demo.object_detection.utils import json_utils
class JsonUtilsTest(tf.test.TestCase):
def testDumpReasonablePrecision(self):
output_path = os.path.join(tf.test.get_temp_dir(), 'test.json')
with tf.gfile.GFile(output_path, 'w') as f:
json_ut... | true | true |
1c3901ca5ab816802d479374ebb2045f07d00596 | 2,584 | py | Python | whyis_classifier/test_whyis_classifier.py | roryschadler/whyis_classifier | e0c41fb2b01311c40979764265b79fd7bd771794 | [
"MIT"
] | null | null | null | whyis_classifier/test_whyis_classifier.py | roryschadler/whyis_classifier | e0c41fb2b01311c40979764265b79fd7bd771794 | [
"MIT"
] | null | null | null | whyis_classifier/test_whyis_classifier.py | roryschadler/whyis_classifier | e0c41fb2b01311c40979764265b79fd7bd771794 | [
"MIT"
] | null | null | null | """ Provides a testing framework for the Classifier Agent."""
from rdflib import *
from rdflib.namespace import RDF
from whyis_classifier import classifier_agent as ca
from whyis_classifier import testclassifier
from whyis_classifier import whyisclassifier
from whyis import nanopub
from whyis.test.agent_unit_test_ca... | 39.151515 | 114 | 0.664861 |
from rdflib import *
from rdflib.namespace import RDF
from whyis_classifier import classifier_agent as ca
from whyis_classifier import testclassifier
from whyis_classifier import whyisclassifier
from whyis import nanopub
from whyis.test.agent_unit_test_case import AgentUnitTestCase
from whyis.namespace import sio
... | true | true |
1c3902c997e7058ff982752470db9ce9e18556b9 | 21,647 | py | Python | cirq/sim/simulator.py | davemc84/Cirq | 713e016d32be99efb0fd4d3e6dbe6d9ca8421271 | [
"Apache-2.0"
] | 2 | 2019-04-02T09:16:28.000Z | 2019-05-25T18:35:19.000Z | cirq/sim/simulator.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | null | null | null | cirq/sim/simulator.py | babbush/Cirq | 447b2c762cc2820dd28abb3bd2bc785d36bae39a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 40.613508 | 80 | 0.633714 |
from typing import (
Any, Dict, Hashable, Iterator, List, Tuple, Union, Optional)
import abc
import collections
import numpy as np
from cirq import circuits, ops, protocols, schedules, study, value
from cirq.sim import sampler
class SimulatesSamples(sampler.Sampler, metaclass=abc.ABCMeta):
... | true | true |
1c3903d9c614c2f662c464f37994e6c31336906e | 167 | py | Python | python/8kyu/opposites_attracks.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | 3 | 2021-06-08T01:57:13.000Z | 2021-06-26T10:52:47.000Z | python/8kyu/opposites_attracks.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | null | null | null | python/8kyu/opposites_attracks.py | Sigmanificient/codewars | b34df4bf55460d312b7ddf121b46a707b549387a | [
"MIT"
] | 2 | 2021-06-10T21:20:13.000Z | 2021-06-30T10:13:26.000Z | """Kata url: https://www.codewars.com/kata/555086d53eac039a2a000083."""
def lovefunc(flower1: int, flower2: int) -> bool:
return bool(flower1 % 2 - flower2 % 2)
| 27.833333 | 71 | 0.688623 |
def lovefunc(flower1: int, flower2: int) -> bool:
return bool(flower1 % 2 - flower2 % 2)
| true | true |
1c3903ef11cf30ab618c0f857e68e2d515607a88 | 11,794 | py | Python | matched_markets_fixed/utils.py | ntellakula/fixed_matched_markets | 187827e614f398d414019a68ec093a39ca8fadfd | [
"MIT"
] | null | null | null | matched_markets_fixed/utils.py | ntellakula/fixed_matched_markets | 187827e614f398d414019a68ec093a39ca8fadfd | [
"MIT"
] | null | null | null | matched_markets_fixed/utils.py | ntellakula/fixed_matched_markets | 187827e614f398d414019a68ec093a39ca8fadfd | [
"MIT"
] | null | null | null | # Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 38.292208 | 80 | 0.664151 |
import random
import re
from typing import List
import altair as alt
from matched_markets_fixed.methodology import common_classes
import numpy as np
import pandas as pd
from pandas.api.types import is_numeric_dtype
TimeWindow = common_classes.TimeWindow
def kwarg_subdict(prefix, **kwargs):
rgx ... | true | true |
1c3905c8a414bd1df7bcaf0c0e38c79c313ebff3 | 18,262 | py | Python | tests/test_main.py | dstathis/charmcraft | d892b3f301dfeef8a9ba597be30d521a1f29a30e | [
"Apache-2.0"
] | null | null | null | tests/test_main.py | dstathis/charmcraft | d892b3f301dfeef8a9ba597be30d521a1f29a30e | [
"Apache-2.0"
] | null | null | null | tests/test_main.py | dstathis/charmcraft | d892b3f301dfeef8a9ba597be30d521a1f29a30e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 33.324818 | 97 | 0.664604 |
import argparse
import io
import os
import pathlib
import subprocess
import sys
from unittest.mock import patch
from charmcraft import __version__, logsetup
from charmcraft.main import Dispatcher, main, COMMAND_GROUPS
from charmcraft.cmdbase import BaseCommand, CommandError
from tests.factory import cr... | true | true |
1c3905ddf3a4668d405567ec585b908595c453dc | 1,824 | py | Python | gym_minigrid/envs/distshift.py | HelgeS/gym-minigrid | af7f0e9473d9ef1365779e27af3143c40dda07e0 | [
"BSD-3-Clause"
] | 2 | 2021-12-06T20:45:55.000Z | 2022-03-15T21:09:15.000Z | gym_minigrid/envs/distshift.py | HelgeS/gym-minigrid | af7f0e9473d9ef1365779e27af3143c40dda07e0 | [
"BSD-3-Clause"
] | null | null | null | gym_minigrid/envs/distshift.py | HelgeS/gym-minigrid | af7f0e9473d9ef1365779e27af3143c40dda07e0 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T21:04:37.000Z | 2022-01-11T21:04:37.000Z | from gym_minigrid.minigrid import *
from gym_minigrid.register import register
class DistShiftEnv(MiniGridEnv):
"""
Distributional shift environment.
"""
def __init__(
self,
width=9,
height=7,
agent_start_pos=(1,1),
agent_start_dir=0,
strip2_row=2
):... | 25.690141 | 56 | 0.611294 | from gym_minigrid.minigrid import *
from gym_minigrid.register import register
class DistShiftEnv(MiniGridEnv):
def __init__(
self,
width=9,
height=7,
agent_start_pos=(1,1),
agent_start_dir=0,
strip2_row=2
):
self.agent_start_pos = agent_start_pos
... | true | true |
1c3906b61a2bdcb4997a349270dd185d2a2fab40 | 5,883 | py | Python | catkin_ws/src/ros_pa3/scripts/markers_example.py | SwellMai/Terminator-800 | df7b31780aa950e407d4f50fbbfb150959ec4192 | [
"MIT"
] | null | null | null | catkin_ws/src/ros_pa3/scripts/markers_example.py | SwellMai/Terminator-800 | df7b31780aa950e407d4f50fbbfb150959ec4192 | [
"MIT"
] | null | null | null | catkin_ws/src/ros_pa3/scripts/markers_example.py | SwellMai/Terminator-800 | df7b31780aa950e407d4f50fbbfb150959ec4192 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Ref 1: http://wiki.ros.org/rviz/DisplayTypes/Marker
# Ref 2: https://answers.ros.org/question/203782/rviz-marker-line_strip-is-not-displayed/
import rospy
from visualization_msgs.msg import Marker
from geometry_msgs.msg import Point
rospy.loginfo('Rviz example')
def display_line_list(points... | 33.050562 | 95 | 0.654088 |
import rospy
from visualization_msgs.msg import Marker
from geometry_msgs.msg import Point
rospy.loginfo('Rviz example')
def display_line_list(points, publisher):
marker = Marker()
marker.header.frame_id = "/map"
marker.type = marker.LINE_LIST
marker.action = mar... | true | true |
1c39089dece05e9048b900f460e1e2cfed1a3266 | 3,404 | py | Python | pcg_libraries/src/pcg_gazebo/task_manager/simulation_timer.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 42 | 2019-06-26T09:46:03.000Z | 2022-03-18T17:56:26.000Z | pcg_libraries/src/pcg_gazebo/task_manager/simulation_timer.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2019-07-18T10:36:05.000Z | 2020-10-02T15:26:32.000Z | pcg_libraries/src/pcg_gazebo/task_manager/simulation_timer.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-11-01T03:20:11.000Z | 2020-10-15T23:23:44.000Z | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | 40.52381 | 117 | 0.65658 |
from time import time, sleep
from threading import Thread
from rosgraph_msgs.msg import Clock
import rospy
from ..log import create_logger
class SimulationTimer(Thread):
def __init__(self, simulation_timeout=0, start_gazebo_timeout=60, ros_config=None,
output_log_dir=None, callback... | true | true |
1c390924433878cc4300f06e61fa07ebe7d9ea64 | 5,040 | py | Python | d3mdm/__main__.py | HDI-Project/d3m-dataset-manager | fdba854cd88a5731dae5213b6c32874a50610e7b | [
"MIT"
] | 3 | 2021-09-27T00:53:54.000Z | 2022-02-26T09:06:48.000Z | d3mdm/__main__.py | HDI-Project/d3m-dataset-manager | fdba854cd88a5731dae5213b6c32874a50610e7b | [
"MIT"
] | null | null | null | d3mdm/__main__.py | HDI-Project/d3m-dataset-manager | fdba854cd88a5731dae5213b6c32874a50610e7b | [
"MIT"
] | 2 | 2019-12-07T17:59:35.000Z | 2021-09-27T00:53:55.000Z | # -*- coding: utf-8 -*-
import gc
import logging
import os
from getpass import getpass
from d3mdm import d3m, local, s3
from d3mdm.splitter import add_dataset_splits
LOGGER = logging.getLogger(__name__)
def logging_setup(verbosity=1):
logger = logging.getLogger()
log_level = (3 - verbosity) * 10
fmt = ... | 31.698113 | 97 | 0.624405 |
import gc
import logging
import os
from getpass import getpass
from d3mdm import d3m, local, s3
from d3mdm.splitter import add_dataset_splits
LOGGER = logging.getLogger(__name__)
def logging_setup(verbosity=1):
logger = logging.getLogger()
log_level = (3 - verbosity) * 10
fmt = '%(levelname)s - %(mess... | true | true |
1c39094515abba4603acfc585af47cc40b45b3eb | 3,265 | py | Python | 2_structures_lineaires/liste.py | efloti/cours-nsi-terminale | 091df5518c25b50ef523a803ac747c63be76f670 | [
"CC0-1.0"
] | null | null | null | 2_structures_lineaires/liste.py | efloti/cours-nsi-terminale | 091df5518c25b50ef523a803ac747c63be76f670 | [
"CC0-1.0"
] | null | null | null | 2_structures_lineaires/liste.py | efloti/cours-nsi-terminale | 091df5518c25b50ef523a803ac747c63be76f670 | [
"CC0-1.0"
] | null | null | null | class Cellule:
"""Fondation du type ListeSimple"""
def __init__(self, valeur, suivante=None):
self.valeur = valeur
self._suivante = suivante # éviter de jouer avec ce pointeur...
@property
def suivante(self):
return self._suivante
def __str__(self):
if self._suivan... | 28.391304 | 108 | 0.583155 | class Cellule:
def __init__(self, valeur, suivante=None):
self.valeur = valeur
self._suivante = suivante
@property
def suivante(self):
return self._suivante
def __str__(self):
if self._suivante is None:
return f"{self.valeur}"
return f"{self.valeur... | true | true |
1c3909bc4bd933e38f38b04f0fc61f7b50cb080d | 227 | py | Python | helper.py | mohammadjafri1992/simple_py_cli | a77b5fc27813b4b1572613d6ffb5f8b2d7647a55 | [
"MIT"
] | null | null | null | helper.py | mohammadjafri1992/simple_py_cli | a77b5fc27813b4b1572613d6ffb5f8b2d7647a55 | [
"MIT"
] | 1 | 2020-08-07T03:13:08.000Z | 2020-08-07T03:13:08.000Z | helper.py | mohammadjafri1992/simple_py_cli | a77b5fc27813b4b1572613d6ffb5f8b2d7647a55 | [
"MIT"
] | null | null | null | def _greet_user(user):
print("Hello, ", user)
def get_user():
user = input("What is your name?")
return user
def interface_with_user(user):
_greet_user(user)
# Test# 11: This is another test for GitKraken. Not merging.
| 17.461538 | 60 | 0.713656 | def _greet_user(user):
print("Hello, ", user)
def get_user():
user = input("What is your name?")
return user
def interface_with_user(user):
_greet_user(user)
| true | true |
1c390a4922c1bec8289b04732867bd2ca4a2da77 | 3,674 | py | Python | UNIOA/optimizer_running.py | Huilin-Li/UNIOA | 0f2527eac955a7193406775e5b71fab35f064422 | [
"MIT"
] | null | null | null | UNIOA/optimizer_running.py | Huilin-Li/UNIOA | 0f2527eac955a7193406775e5b71fab35f064422 | [
"MIT"
] | null | null | null | UNIOA/optimizer_running.py | Huilin-Li/UNIOA | 0f2527eac955a7193406775e5b71fab35f064422 | [
"MIT"
] | null | null | null | import time
import ioh
from datetime import datetime
from .algs import *
import sys, os
from pydoc import locate
# def optimizer_running(problems, instances, dimensions, num_runs, paras_set, optimizer_name, output_name):
# Which_alg = output_name.split("_")[1]
# folder_name = Which_alg + '_folder'
# data_n... | 44.26506 | 120 | 0.555253 | import time
import ioh
from datetime import datetime
from .algs import *
import sys, os
from pydoc import locate
er_running(problems, instances, dimensions, num_runs, paras_set, optimizer_name):
t = 0
optimizer_name_temp = optimizer_name
UNIOA_algs = ['BA_UNIOA', 'CSA_UNIOA', 'MFO_UNIOA', '... | true | true |
1c390c681c2d3660293795ee39f4549157cbf995 | 3,947 | py | Python | tests/unit/viz/test_legend.py | manmorjim/cartoframes | 4172e3dcdaedf207c10772a6dffe4f43b1993230 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/viz/test_legend.py | manmorjim/cartoframes | 4172e3dcdaedf207c10772a6dffe4f43b1993230 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/viz/test_legend.py | manmorjim/cartoframes | 4172e3dcdaedf207c10772a6dffe4f43b1993230 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from cartoframes.viz import Legend
class TestLegend(object):
def test_is_legend_defined(self):
"""Legend"""
assert Legend is not None
def test_legend_init_dict(self):
"""Legend should be properly initialized when passing a dict"""
legend = Legend({
'... | 36.546296 | 109 | 0.53965 | import pytest
from cartoframes.viz import Legend
class TestLegend(object):
def test_is_legend_defined(self):
assert Legend is not None
def test_legend_init_dict(self):
legend = Legend({
'type': 'color-category',
'prop': 'strokeColor',
'title': '[TITLE]',
... | true | true |
1c390d3b6b3f17050b35232ecaab5093ede0711c | 336 | py | Python | helpline/qpanel/rq_worker.py | mbai93/myhelpline-1 | 8c6130ad7ce9637565e83988a45c0b2ff9c5d698 | [
"BSD-3-Clause"
] | 1 | 2018-07-15T13:13:43.000Z | 2018-07-15T13:13:43.000Z | helpline/qpanel/rq_worker.py | mbai93/myhelpline-1 | 8c6130ad7ce9637565e83988a45c0b2ff9c5d698 | [
"BSD-3-Clause"
] | 14 | 2018-07-10T12:48:46.000Z | 2022-03-11T23:24:51.000Z | helpline/qpanel/rq_worker.py | mbai93/myhelpline-1 | 8c6130ad7ce9637565e83988a45c0b2ff9c5d698 | [
"BSD-3-Clause"
] | 5 | 2018-07-04T07:59:14.000Z | 2020-01-28T07:50:18.000Z | from panel.qpanel.job import start_process
from multiprocessing import Process
from rq_scheduler.scripts.rqscheduler import main
def start_jobs():
p = Process(target=start_process)
p.start()
start_scheduler()
def start_scheduler():
p = Process(target=main)
p.start()
if __name__ == '__main__':
... | 18.666667 | 49 | 0.72619 | from panel.qpanel.job import start_process
from multiprocessing import Process
from rq_scheduler.scripts.rqscheduler import main
def start_jobs():
p = Process(target=start_process)
p.start()
start_scheduler()
def start_scheduler():
p = Process(target=main)
p.start()
if __name__ == '__main__':
... | true | true |
1c390e23f28cb806d6b057d3dc02d45614c84697 | 996 | py | Python | account/urls.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | 1 | 2020-11-17T13:08:07.000Z | 2020-11-17T13:08:07.000Z | account/urls.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | null | null | null | account/urls.py | zerolfx/eoj3 | 156060399d1c3e5f7bcdbf34eaffbe2be66e1b20 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from utils.site_settings import force_closed
from . import views
app_name = "account"
urlpatterns = [
url(r'^settings/profile/$', views.UpdateProfileView.as_view(), name='profile', kwargs=force_closed()),
url(r'^settings/security/$', views.my_password_change, name='security',... | 49.8 | 116 | 0.710843 | from django.conf.urls import url
from utils.site_settings import force_closed
from . import views
app_name = "account"
urlpatterns = [
url(r'^settings/profile/$', views.UpdateProfileView.as_view(), name='profile', kwargs=force_closed()),
url(r'^settings/security/$', views.my_password_change, name='security',... | true | true |
1c390f513174f38db1d3c2c1982522569666ed0f | 4,592 | py | Python | abusehelper/core/handlers.py | AbuseSA/abusehelper | 3e953632d20317c6bfe7eeb987ea9104d8f2a957 | [
"MIT"
] | 117 | 2015-11-30T09:52:52.000Z | 2021-11-24T23:58:13.000Z | abusehelper/core/handlers.py | AbuseSA/abusehelper | 3e953632d20317c6bfe7eeb987ea9104d8f2a957 | [
"MIT"
] | 57 | 2015-12-08T10:06:57.000Z | 2018-03-28T11:13:11.000Z | abusehelper/core/handlers.py | AbuseSA/abusehelper | 3e953632d20317c6bfe7eeb987ea9104d8f2a957 | [
"MIT"
] | 29 | 2016-02-08T08:24:30.000Z | 2022-03-31T13:53:15.000Z | import json
import collections
from . import bot, utils
class HandlerParam(bot.Param):
def parse(self, value):
try:
return json.loads(value)
except ValueError:
return value
def load_handler(handler_spec):
"""
>>> import logging
>>> log = logging.getLogger("du... | 28.521739 | 100 | 0.633493 | import json
import collections
from . import bot, utils
class HandlerParam(bot.Param):
def parse(self, value):
try:
return json.loads(value)
except ValueError:
return value
def load_handler(handler_spec):
if isinstance(handler_spec, collections.Mapping):
han... | true | true |
1c39104a082000a3ca295c53bab812baf8df9962 | 1,656 | py | Python | app/tool_results/microbe_directory/tests/factory.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/microbe_directory/tests/factory.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | app/tool_results/microbe_directory/tests/factory.py | MetaGenScope/metagenscope-server | 609cd57c626c857c8efde8237a1f22f4d1e6065d | [
"MIT"
] | null | null | null | """Factory for generating Kraken result models for testing."""
from random import random
from app.tool_results.microbe_directory import MicrobeDirectoryToolResult
def create_values():
"""Create microbe directory values."""
return {
'gram_stain': {
'gram_positive': random(),
'... | 26.285714 | 73 | 0.490942 |
from random import random
from app.tool_results.microbe_directory import MicrobeDirectoryToolResult
def create_values():
return {
'gram_stain': {
'gram_positive': random(),
'gram_negative': random(),
'unknown': random(),
},
'microbiome_location': {
... | true | true |
1c391078e21a3e42bb1c73182f9827a91c3d06ee | 16,562 | py | Python | bird/_bird.py | wavelets/bird | ae0fe470a6517e34bfe8713fe389f0a2dd223afe | [
"BSD-3-Clause"
] | 1 | 2017-05-05T20:15:44.000Z | 2017-05-05T20:15:44.000Z | bird/_bird.py | wavelets/bird | ae0fe470a6517e34bfe8713fe389f0a2dd223afe | [
"BSD-3-Clause"
] | null | null | null | bird/_bird.py | wavelets/bird | ae0fe470a6517e34bfe8713fe389f0a2dd223afe | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Manuel Moussallam <manuel.moussallam@gmail.com>
#
# Algorithm presented here are described in:
# Blind Denoising with Random Greedy Pursuits.
# Moussallam, M., Gramfort, A., Daudet, L., & Richard, G. (2014).
# IEE... | 37.134529 | 79 | 0.586282 |
from math import sqrt
import multiprocessing
from functools import partial
import numpy as np
from scipy.special import erfinv
from scipy import linalg
from joblib import Parallel, delayed, Memory
from mdct_tools import mdct_waveform, mdct, MDCT
def check_random_state(seed):
if seed is None or seed i... | true | true |
1c3910cf551f794e5779d21ed10f3b3bae511add | 7,975 | py | Python | lib/galaxy/workflow/resources/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | lib/galaxy/workflow/resources/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 52 | 2015-03-16T14:02:14.000Z | 2021-12-24T09:50:23.000Z | lib/galaxy/workflow/resources/__init__.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2016-03-21T12:54:06.000Z | 2016-03-21T12:54:06.000Z | """This package is something a placeholder for workflow resource parameters.
This file defines the baked in resource mapper types, and this package contains an
example of a more open, pluggable approach with greater control.
"""
import functools
import logging
import os
import sys
from copy import deepcopy
import yam... | 45.3125 | 138 | 0.61442 | import functools
import logging
import os
import sys
from copy import deepcopy
import yaml
import galaxy.util
log = logging.getLogger(__name__)
def get_resource_mapper_function(app):
config = app.config
mapper = getattr(config, "workflow_resource_params_mapper", None)
if mapper is None:
return... | true | true |
1c391150740bb4b197ee22feca4f17cc88087007 | 579 | py | Python | hellowebapp/settings_production.py | cesmus/hellowebapp | 83a1a0018d4ba3fffb6e4fc78d5502bffcd3ec50 | [
"MIT"
] | 49 | 2015-03-16T16:17:33.000Z | 2017-08-18T16:24:51.000Z | hellowebapp/settings_production.py | cesmus/hellowebapp | 83a1a0018d4ba3fffb6e4fc78d5502bffcd3ec50 | [
"MIT"
] | 1 | 2015-07-23T16:41:07.000Z | 2015-07-25T15:14:34.000Z | hellowebapp/settings_production.py | cesmus/hellowebapp | 83a1a0018d4ba3fffb6e4fc78d5502bffcd3ec50 | [
"MIT"
] | 16 | 2017-10-20T19:51:26.000Z | 2021-05-13T05:12:33.000Z | # Inherit from standard settings file for defaults
from hellowebapp.settings import *
# Everything below will override our standard settings:
# Parse database configuration from $DATABASE_URL
import dj_database_url
DATABASES['default'] = dj_database_url.config()
# Honor the 'X-Forwarded-Proto' header for request.is_... | 28.95 | 72 | 0.7962 |
from hellowebapp.settings import *
import dj_database_url
DATABASES['default'] = dj_database_url.config()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
ALLOWED_HOSTS = ['*']
DEBUG = False
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
| true | true |
1c39140645f257e2db64c393e1af682f66d7985f | 60,018 | py | Python | test/onnx/test_utility_funs.py | wayi1/pytorch | e832ff58bf93fb1bcb2292219f6c98ab3c842484 | [
"Intel"
] | 2 | 2020-03-13T06:57:49.000Z | 2020-05-17T04:18:14.000Z | test/onnx/test_utility_funs.py | wayi1/pytorch | e832ff58bf93fb1bcb2292219f6c98ab3c842484 | [
"Intel"
] | null | null | null | test/onnx/test_utility_funs.py | wayi1/pytorch | e832ff58bf93fb1bcb2292219f6c98ab3c842484 | [
"Intel"
] | null | null | null | # Owner(s): ["module: onnx"]
import copy
import io
import unittest
import onnx
import torchvision
from autograd_helper import CustomFunction as CustomFunction2
from test_pytorch_common import (
TestCase,
run_tests,
skipIfNoCuda,
skipIfUnsupportedMaxOpsetVersion,
skipIfUnsupportedMinOpsetVersion,
)... | 36.133654 | 124 | 0.561915 |
import copy
import io
import unittest
import onnx
import torchvision
from autograd_helper import CustomFunction as CustomFunction2
from test_pytorch_common import (
TestCase,
run_tests,
skipIfNoCuda,
skipIfUnsupportedMaxOpsetVersion,
skipIfUnsupportedMinOpsetVersion,
)
from verify import verify
... | true | true |
1c3914fede50b34f4b2f062825b934eb1dadb5ab | 1,545 | py | Python | setup.py | akalex/aiohttp_prometheus_exporter | d6e80e86a63bf568d175929e7a7d9ee039af5a68 | [
"MIT"
] | null | null | null | setup.py | akalex/aiohttp_prometheus_exporter | d6e80e86a63bf568d175929e7a7d9ee039af5a68 | [
"MIT"
] | null | null | null | setup.py | akalex/aiohttp_prometheus_exporter | d6e80e86a63bf568d175929e7a7d9ee039af5a68 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['aiohttp>=3', 'prometheus_client>=0.6', ]
setup_requirements... | 31.530612 | 101 | 0.680906 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['aiohttp>=3', 'prometheus_client>=0.6', ]
setup_requirements = ['pytest-runner', ]
test_requirements = [... | true | true |
1c3915103ce7e41f0dbb2e8b1a313e4f0a23f4fd | 2,307 | py | Python | examples/dfp/v201411/creative_service/get_creatives_by_statement.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | 1 | 2015-08-12T14:47:40.000Z | 2015-08-12T14:47:40.000Z | examples/dfp/v201411/creative_service/get_creatives_by_statement.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | 1 | 2020-07-24T15:10:10.000Z | 2020-07-24T15:10:10.000Z | examples/dfp/v201411/creative_service/get_creatives_by_statement.py | coxmediagroup/googleads-python-lib | f85d5d8ab771e93b03b616ef65e2d3082aeef484 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.60274 | 77 | 0.700043 |
"""This code example gets all image creatives.
To create an image creative, run create_creatives.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authenti... | false | true |
1c391551e0a5354e37d07670d112ae687c8b0879 | 4,663 | py | Python | python/zephyr/constants.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | 18 | 2021-05-27T04:40:38.000Z | 2022-02-08T19:46:31.000Z | python/zephyr/constants.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | null | null | null | python/zephyr/constants.py | r-pad/zephyr | c8f45e207c11bfc2b21df169db65a7df892d2848 | [
"MIT"
] | 2 | 2021-11-07T12:42:00.000Z | 2022-03-01T12:51:54.000Z | FEATURE_MEAN = [491.3183898925781, 445.4370422363281, 104.46714782714844, -9.33281421661377, -0.3871251940727234, 15.277295112609863, 96.35192108154297, -21.257665634155273, 244.6168975830078, 454.5150146484375, 452.712890625, 93.33969116210938, 96.92170715332031, 0.4305391013622284, 0.39397644996643066, 0.101892776787... | 43.175926 | 798 | 0.668239 | FEATURE_MEAN = [491.3183898925781, 445.4370422363281, 104.46714782714844, -9.33281421661377, -0.3871251940727234, 15.277295112609863, 96.35192108154297, -21.257665634155273, 244.6168975830078, 454.5150146484375, 452.712890625, 93.33969116210938, 96.92170715332031, 0.4305391013622284, 0.39397644996643066, 0.101892776787... | true | true |
1c3915f44fe7d8202f20a3318d5e5194a160286a | 2,067 | py | Python | UiMainWindowLoginByFaceID.py | kyvipro113/FaceID_Realtime_Detect | b4942091ade34b38b761808386991b919d29c1d3 | [
"MIT"
] | 1 | 2021-07-01T10:25:14.000Z | 2021-07-01T10:25:14.000Z | Ui_MainWindowLoginByFaceID.py | kyvipro113/FaceID_Realtime_Detect | b4942091ade34b38b761808386991b919d29c1d3 | [
"MIT"
] | null | null | null | Ui_MainWindowLoginByFaceID.py | kyvipro113/FaceID_Realtime_Detect | b4942091ade34b38b761808386991b919d29c1d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Ui_MainWindowLoginByFaceID.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 ... | 41.34 | 117 | 0.742622 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindowLoginByFaceID(object):
def setupUi(self, MainWindowLoginByFaceID):
MainWindowLoginByFaceID.setObjectName("MainWindowLoginByFaceID")
MainWindowLoginByFaceID.resize(640, 497)
self.centralwidget = QtWidgets.QWidget(MainWi... | true | true |
1c3916a50958fbd9772e08319d3a2903ea41a9cc | 4,057 | py | Python | hublib/rappture/test/test_number.py | hzclarksm/hublib | e8f2168d80464b6343b980e30fdd552d1b0c2479 | [
"MIT"
] | 6 | 2017-05-23T19:17:29.000Z | 2022-02-24T00:36:46.000Z | hublib/rappture/test/test_number.py | hzclarksm/hublib | e8f2168d80464b6343b980e30fdd552d1b0c2479 | [
"MIT"
] | 1 | 2019-02-13T13:35:57.000Z | 2019-02-13T13:35:57.000Z | hublib/rappture/test/test_number.py | hzclarksm/hublib | e8f2168d80464b6343b980e30fdd552d1b0c2479 | [
"MIT"
] | 6 | 2017-09-12T19:51:12.000Z | 2021-01-13T23:43:57.000Z | from __future__ import print_function
import pytest
import os, sys
import numpy as np
sys.path.insert(0, os.path.abspath('../../..'))
import hublib.rappture as rappture
from hublib import ureg, Q_
class TestNumber:
@classmethod
def setup_class(cls):
print("cls", cls)
cls.io = rappture.RapXML... | 33.808333 | 72 | 0.624846 | from __future__ import print_function
import pytest
import os, sys
import numpy as np
sys.path.insert(0, os.path.abspath('../../..'))
import hublib.rappture as rappture
from hublib import ureg, Q_
class TestNumber:
@classmethod
def setup_class(cls):
print("cls", cls)
cls.io = rappture.RapXML... | true | true |
1c3916bec016c984790c755d9995f06946dcc489 | 2,686 | py | Python | Banking-Inference/code.py | Shubham-0212/ga-learner-dsmp-repo | ed2ebf13fb959746be3b97a6ece0a1784ebb0166 | [
"MIT"
] | null | null | null | Banking-Inference/code.py | Shubham-0212/ga-learner-dsmp-repo | ed2ebf13fb959746be3b97a6ece0a1784ebb0166 | [
"MIT"
] | null | null | null | Banking-Inference/code.py | Shubham-0212/ga-learner-dsmp-repo | ed2ebf13fb959746be3b97a6ece0a1784ebb0166 | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
data... | 26.333333 | 133 | 0.686895 |
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
sample_size=2000
z_critical = stats.norm.ppf(q = 0.95)
data=pd.read_csv(path)
data_sample=data.sample(n=sample_size,random_state=0)
sample_mean=data_sample.installment... | true | true |
1c3917526a4c1ededdf3dc3e73ebc732d89b14e3 | 232 | py | Python | source/py/cmd/osclient.py | shakfu/pymax | 67dca5990581d91ffcedf800e585e87646ab94d4 | [
"CC0-1.0"
] | 25 | 2020-08-06T12:38:07.000Z | 2022-03-23T17:35:09.000Z | source/py/cmd/osclient.py | shakfu/pymax | 67dca5990581d91ffcedf800e585e87646ab94d4 | [
"CC0-1.0"
] | 7 | 2021-04-02T02:58:56.000Z | 2022-03-31T22:58:19.000Z | source/py/cmd/osclient.py | shakfu/pymax | 67dca5990581d91ffcedf800e585e87646ab94d4 | [
"CC0-1.0"
] | 3 | 2021-04-04T05:47:07.000Z | 2021-06-26T03:30:02.000Z | #!/usr/bin/env python3
from pythonosc import udp_client
client = udp_client.SimpleUDPClient('127.0.0.1', 7000)
while True:
data = input(">>> ")
#client.send_message("/py", data)
client.send_message("/eval", data)
| 15.466667 | 54 | 0.663793 |
from pythonosc import udp_client
client = udp_client.SimpleUDPClient('127.0.0.1', 7000)
while True:
data = input(">>> ")
client.send_message("/eval", data)
| true | true |
1c391a12cc5d4d5f2963496063d83640b2a90b80 | 2,250 | py | Python | qa/rpc-tests/forknotify.py | jwflame/nyancoin-client-1 | 6bc7686edf8bc4b058d504ce0ab40b7cd2a0597b | [
"MIT"
] | 21 | 2021-11-13T17:36:02.000Z | 2022-03-02T15:11:57.000Z | qa/rpc-tests/forknotify.py | jwflame/nyancoin-client-1 | 6bc7686edf8bc4b058d504ce0ab40b7cd2a0597b | [
"MIT"
] | 3 | 2021-07-07T13:55:07.000Z | 2021-11-29T21:05:11.000Z | qa/rpc-tests/forknotify.py | BillionaerCoin/BillionaerCoin | 0e11b0b1fec56191b4ca93496d1881648498cb84 | [
"MIT"
] | 3 | 2021-11-19T23:50:41.000Z | 2021-12-06T23:20:26.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -alertnotify
#
from test_framework.test_framework import BitcoinTestFramework
from test_framew... | 33.58209 | 108 | 0.628 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ForkNotifyTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = False
alert_filename = None
def setup_network... | true | true |
1c391a3dbaf9362a4ff62b973e337301856c968a | 2,250 | py | Python | misc/easytags/highlight.py | bronzehedwick/vim-easytags | 72a8753b5d0a951e547c51b13633f680a95b5483 | [
"MIT"
] | 809 | 2015-01-06T18:49:17.000Z | 2022-03-06T13:37:53.000Z | misc/easytags/highlight.py | bronzehedwick/vim-easytags | 72a8753b5d0a951e547c51b13633f680a95b5483 | [
"MIT"
] | 83 | 2015-01-02T11:36:29.000Z | 2021-05-24T21:58:31.000Z | misc/easytags/highlight.py | bronzehedwick/vim-easytags | 72a8753b5d0a951e547c51b13633f680a95b5483 | [
"MIT"
] | 129 | 2015-02-01T02:52:53.000Z | 2022-03-05T08:50:41.000Z | '''
This Python script is part of the easytags plug-in for the Vim text editor. The
Python Interface to Vim is used to load this script which accelerates dynamic
syntax highlighting by reimplementing tag file reading and :syntax command
generation in Python with a focus on doing the least amount of work.
Author: Peter... | 40.178571 | 106 | 0.662667 | '''
This Python script is part of the easytags plug-in for the Vim text editor. The
Python Interface to Vim is used to load this script which accelerates dynamic
syntax highlighting by reimplementing tag file reading and :syntax command
generation in Python with a focus on doing the least amount of work.
Author: Peter... | false | true |
1c391b33607695b408094e1bb3752379aca6ea4e | 9,199 | py | Python | asposecellscloud/models/name.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | 3 | 2018-05-23T03:16:26.000Z | 2020-11-07T11:42:41.000Z | asposecellscloud/models/name.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | null | null | null | asposecellscloud/models/name.py | aspose-cells-cloud/aspose-cells-cloud-python | 0189236d38053dc67f7edc754b5101f17262cee8 | [
"MIT"
] | 4 | 2018-08-29T18:45:05.000Z | 2021-03-25T07:59:56.000Z | # coding: utf-8
"""
Copyright (c) 2021 Aspose.Cells Cloud
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, ... | 26.819242 | 160 | 0.576584 |
from pprint import pformat
from six import iteritems
import re
class Name(object):
swagger_types = {
'link': 'Link',
'comment': 'str',
'text': 'str',
'worksheet_index': 'int',
'r1_c1_refers_to': 'str',
'refers_to': 'str',
'is_referred': 'bool',
... | true | true |
1c391b51a86d75659c38a1a5c1fac94f650f2f1e | 463 | py | Python | accounts/migrations/0033_auto_20210130_1852.py | noelsj007/ecommerceweb | e00edfe9110d2cc54deebd97043e0aa152c8afd4 | [
"Unlicense"
] | null | null | null | accounts/migrations/0033_auto_20210130_1852.py | noelsj007/ecommerceweb | e00edfe9110d2cc54deebd97043e0aa152c8afd4 | [
"Unlicense"
] | null | null | null | accounts/migrations/0033_auto_20210130_1852.py | noelsj007/ecommerceweb | e00edfe9110d2cc54deebd97043e0aa152c8afd4 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-30 13:22
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0032_auto_20210130_1852'),
]
operations = [
migrations.AlterField(
model_name='order',
n... | 23.15 | 99 | 0.62851 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0032_auto_20210130_1852'),
]
operations = [
migrations.AlterField(
model_name='order',
name='order_ordered_date',
field=mod... | true | true |
1c391b838cbaebe0ca5300f1f7adc660e5fbd8a6 | 5,058 | py | Python | earth/weather/observations.py | justquick/python-earth | ced0d1fff7c2de77df5b51ea490137b0d84d1d96 | [
"MIT"
] | 2 | 2017-12-18T13:12:48.000Z | 2020-01-21T04:18:03.000Z | earth/weather/observations.py | justquick/python-earth | ced0d1fff7c2de77df5b51ea490137b0d84d1d96 | [
"MIT"
] | null | null | null | earth/weather/observations.py | justquick/python-earth | ced0d1fff7c2de77df5b51ea490137b0d84d1d96 | [
"MIT"
] | null | null | null | import os,sys
import zipfile
from xml.parsers.expat import ParserCreate
from datetime import datetime
from urllib import urlretrieve
from earth.core.config import conf
from earth.geo import Location
URL = 'http://www.weather.gov/data/current_obs/all_xml.zip'
URI = os.path.join(conf.data_root, 'observation... | 32.216561 | 87 | 0.536576 | import os,sys
import zipfile
from xml.parsers.expat import ParserCreate
from datetime import datetime
from urllib import urlretrieve
from earth.core.config import conf
from earth.geo import Location
URL = 'http://www.weather.gov/data/current_obs/all_xml.zip'
URI = os.path.join(conf.data_root, 'observation... | true | true |
1c391bf60123cd731b897495b6cd872ba6fb0af6 | 36,120 | py | Python | mrcnn/utils.py | HuchieWuchie/Mask_RCNN | 93f74c5fae72852563b1d3e0e22428d6abf86dc2 | [
"MIT"
] | null | null | null | mrcnn/utils.py | HuchieWuchie/Mask_RCNN | 93f74c5fae72852563b1d3e0e22428d6abf86dc2 | [
"MIT"
] | null | null | null | mrcnn/utils.py | HuchieWuchie/Mask_RCNN | 93f74c5fae72852563b1d3e0e22428d6abf86dc2 | [
"MIT"
] | null | null | null | """
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import sys
import os
import logging
import math
import random
import numpy as np
import tensorflow as tf
import scipy
import skimage.color
imp... | 38.101266 | 117 | 0.612846 |
import sys
import os
import logging
import math
import random
import numpy as np
import tensorflow as tf
import scipy
import skimage.color
import skimage.io
import skimage.transform
import urllib.request
import shutil
import warnings
from distutils.version import LooseVersion
COCO_MODEL_URL = "https://github.com/mat... | true | true |
1c391d1d141f20c8bb8ed6f008fe68893348f80f | 3,342 | py | Python | alipay/aop/api/domain/ExtendParams.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 32 | 2018-05-24T08:40:15.000Z | 2019-04-04T20:54:55.000Z | alipay/aop/api/domain/ExtendParams.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 7 | 2018-05-24T08:42:59.000Z | 2020-09-06T23:18:46.000Z | alipay/aop/api/domain/ExtendParams.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 13 | 2018-04-25T11:27:58.000Z | 2021-03-15T12:22:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class ExtendParams(object):
def __init__(self):
self._card_type = None
self._hb_fq_num = None
self._hb_fq_seller_percent = None
self._industry_reflux_info = None
... | 33.089109 | 97 | 0.642729 |
import json
from alipay.aop.api.constant.ParamConstants import *
class ExtendParams(object):
def __init__(self):
self._card_type = None
self._hb_fq_num = None
self._hb_fq_seller_percent = None
self._industry_reflux_info = None
self._sys_service_provider_id = None
@... | true | true |
1c391d5749ac5da2b4e8d01b62d28ba30433503f | 2,530 | py | Python | attacks/single_key/z3_solver.py | Marius-Sheppard/RsaCtfTool | c6b8e00d54d56e9bcbf0a324e90ecd9446aef839 | [
"Beerware"
] | null | null | null | attacks/single_key/z3_solver.py | Marius-Sheppard/RsaCtfTool | c6b8e00d54d56e9bcbf0a324e90ecd9446aef839 | [
"Beerware"
] | null | null | null | attacks/single_key/z3_solver.py | Marius-Sheppard/RsaCtfTool | c6b8e00d54d56e9bcbf0a324e90ecd9446aef839 | [
"Beerware"
] | 1 | 2021-12-13T15:58:47.000Z | 2021-12-13T15:58:47.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from z3 import Solver, Int ,set_param
from attacks.abstract_attack import AbstractAttack
from gmpy2 import isqrt
from lib.utils import timeout, TimeoutError
from lib.keys_wrapper import PrivateKey
set_param('parallel.enable', True)
class Attack(AbstractAttack):
def _... | 32.857143 | 112 | 0.514625 |
from z3 import Solver, Int ,set_param
from attacks.abstract_attack import AbstractAttack
from gmpy2 import isqrt
from lib.utils import timeout, TimeoutError
from lib.keys_wrapper import PrivateKey
set_param('parallel.enable', True)
class Attack(AbstractAttack):
def __init__(self, timeout=60):
super().__... | true | true |
1c391d5ed05feb1b0e23072fa66197a57a837bf5 | 2,565 | py | Python | quartical/apps/backup.py | JSKenyon/QuartiCal | 2113855b080cfecc4a1c77cc9dad346ef3619716 | [
"MIT"
] | null | null | null | quartical/apps/backup.py | JSKenyon/QuartiCal | 2113855b080cfecc4a1c77cc9dad346ef3619716 | [
"MIT"
] | null | null | null | quartical/apps/backup.py | JSKenyon/QuartiCal | 2113855b080cfecc4a1c77cc9dad346ef3619716 | [
"MIT"
] | 1 | 2022-03-18T14:30:04.000Z | 2022-03-18T14:30:04.000Z | import argparse
from daskms import xds_from_ms, xds_to_table
from daskms.experimental.zarr import xds_to_zarr, xds_from_zarr
from pathlib import Path
import time
import dask
def backup():
parser = argparse.ArgumentParser(
description='Backup any Measurement Set column to zarr. Backups will '
... | 27 | 78 | 0.607797 | import argparse
from daskms import xds_from_ms, xds_to_table
from daskms.experimental.zarr import xds_to_zarr, xds_from_zarr
from pathlib import Path
import time
import dask
def backup():
parser = argparse.ArgumentParser(
description='Backup any Measurement Set column to zarr. Backups will '
... | true | true |
1c391df30f14ef0733bb52c2cdf6a72596913d64 | 3,649 | py | Python | esm/pretrained.py | konstin/esm | a39894c079ce314e1c0aaa607e8ae498111910a0 | [
"MIT"
] | null | null | null | esm/pretrained.py | konstin/esm | a39894c079ce314e1c0aaa607e8ae498111910a0 | [
"MIT"
] | null | null | null | esm/pretrained.py | konstin/esm | a39894c079ce314e1c0aaa607e8ae498111910a0 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import esm
import torch
from argparse import Namespace
from .constants import proteinseq_toks
def load_model_and_alphabet(model_name):
if... | 36.128713 | 110 | 0.725678 |
import esm
import torch
from argparse import Namespace
from .constants import proteinseq_toks
def load_model_and_alphabet(model_name):
if model_name.endswith(".pt"):
return load_model_and_alphabet_local(model_name)
else:
return load_model_and_alphabet_hub(model_name)
def load_model_and_... | true | true |
1c391e377f29162aac3ee75ece710cd23fd7e65e | 799 | py | Python | ds2bim2-Adrian/usuariodao.py | adrianpastore/trabds2bim2 | 72232dfb27cdaf3d8ff99fccabf8612a803d4903 | [
"MIT"
] | null | null | null | ds2bim2-Adrian/usuariodao.py | adrianpastore/trabds2bim2 | 72232dfb27cdaf3d8ff99fccabf8612a803d4903 | [
"MIT"
] | null | null | null | ds2bim2-Adrian/usuariodao.py | adrianpastore/trabds2bim2 | 72232dfb27cdaf3d8ff99fccabf8612a803d4903 | [
"MIT"
] | null | null | null | from usuario import Usuario
from psycopg2 import connect
from dao import DAO
class UsuarioDao(DAO):
def __init__(self):
super().__init__()
def buscar(self, usuario):
with connect(self._dados_con) as conn:
cur = conn.cursor()
cur.execute('SELECT * from "usuario" WHER... | 31.96 | 117 | 0.56821 | from usuario import Usuario
from psycopg2 import connect
from dao import DAO
class UsuarioDao(DAO):
def __init__(self):
super().__init__()
def buscar(self, usuario):
with connect(self._dados_con) as conn:
cur = conn.cursor()
cur.execute('SELECT * from "usuario" WHER... | true | true |
1c391e3c0170ee0db296746981821f8c2c9b4e91 | 4,200 | py | Python | pypureclient/flashblade/FB_2_3/models/session_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flashblade/FB_2_3/models/session_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flashblade/FB_2_3/models/session_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashBlade REST API
A lightweight client for FlashBlade REST API 2.3, developed by Pure Storage, Inc. (http://www.purestorage.com/).
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typ... | 33.870968 | 530 | 0.585952 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flashblade.FB_2_3 import models
class SessionGetResponse(object):
swagger_types = {
'continuation_token': 'str',
'total_item_count': 'int',
'items': 'lis... | true | true |
1c391e5facf5849bcd0968b6857debfbf9b22501 | 9,328 | py | Python | bincrafters/build_shared.py | rockdreamer/bincrafters-package-tools | 75781ef72e756888dd6f1dc48ae8bb3c97afb5ea | [
"MIT"
] | null | null | null | bincrafters/build_shared.py | rockdreamer/bincrafters-package-tools | 75781ef72e756888dd6f1dc48ae8bb3c97afb5ea | [
"MIT"
] | null | null | null | bincrafters/build_shared.py | rockdreamer/bincrafters-package-tools | 75781ef72e756888dd6f1dc48ae8bb3c97afb5ea | [
"MIT"
] | null | null | null | import os
import re
import platform
from conans.client import conan_api
from cpt.packager import ConanMultiPackager
from cpt.tools import split_colon_env
from cpt.remotes import RemotesManager
# from cpt.ci_manager import *
from cpt.printer import Printer
from bincrafters.build_paths import BINCRAFTERS_REPO_URL, BINCRA... | 34.168498 | 129 | 0.690609 | import os
import re
import platform
from conans.client import conan_api
from cpt.packager import ConanMultiPackager
from cpt.tools import split_colon_env
from cpt.remotes import RemotesManager
from cpt.printer import Printer
from bincrafters.build_paths import BINCRAFTERS_REPO_URL, BINCRAFTERS_LOGIN_USERNAME, BINCRAFT... | true | true |
1c391f6ada311b0f09e8e8fff75fe6bb1938ca33 | 12,918 | py | Python | chap11/cuppa4_interp/cuppa4_fe.py | lutzhamel/plipy-code | b4f8c465cddbc0b51d6d6487535d3171ce4f13ee | [
"BSD-2-Clause"
] | 1 | 2021-09-17T15:27:53.000Z | 2021-09-17T15:27:53.000Z | chap11/cuppa4/cuppa4_fe.py | lutzhamel/plipy-code | b4f8c465cddbc0b51d6d6487535d3171ce4f13ee | [
"BSD-2-Clause"
] | null | null | null | chap11/cuppa4/cuppa4_fe.py | lutzhamel/plipy-code | b4f8c465cddbc0b51d6d6487535d3171ce4f13ee | [
"BSD-2-Clause"
] | 4 | 2021-09-17T15:27:58.000Z | 2021-11-17T01:18:37.000Z | '''
Frontend for our Cuppa4 language - builds an AST where each
node is of the shape,
(TYPE, [arg1, arg2, arg3,...])
here TYPE is a string describing the node type.
'''
# helper function to compute the type of a function
def formalargs_type(args):
output_list = list()
for a in args[1]:
(FORMALARG... | 35.00813 | 105 | 0.549466 |
def formalargs_type(args):
output_list = list()
for a in args[1]:
(FORMALARG, type, id) = a
output_list.append(type)
return ('LIST', output_list)
stmt_lookahead = [
'VOID_TYPE',
'INTEGER_TYPE',
'FLOAT_TYPE',
'STRING_TYPE',
'ID',
'GET',
'PUT',
'RETURN',
... | true | true |
1c39203f14a1c227593183bf54901f5572687633 | 7,062 | py | Python | packages/python/plotly/plotly/tests/test_io/test_to_from_json.py | astafan8/plotly.py | c67f80067210d66e61c2f8f5e3b746a9a6c739a0 | [
"MIT"
] | 1 | 2022-01-22T04:10:29.000Z | 2022-01-22T04:10:29.000Z | packages/python/plotly/plotly/tests/test_io/test_to_from_json.py | astafan8/plotly.py | c67f80067210d66e61c2f8f5e3b746a9a6c739a0 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/tests/test_io/test_to_from_json.py | astafan8/plotly.py | c67f80067210d66e61c2f8f5e3b746a9a6c739a0 | [
"MIT"
] | 1 | 2022-02-07T14:42:35.000Z | 2022-02-07T14:42:35.000Z | import plotly.graph_objs as go
import plotly.io as pio
import pytest
import plotly
import json
import os
import tempfile
from unittest.mock import MagicMock
from pathlib import Path
# fixtures
# --------
@pytest.fixture
def fig1(request):
return go.Figure(
data=[
{"type": "scattergl", "marker"... | 26.851711 | 85 | 0.65817 | import plotly.graph_objs as go
import plotly.io as pio
import pytest
import plotly
import json
import os
import tempfile
from unittest.mock import MagicMock
from pathlib import Path
@pytest.fixture
def fig1(request):
return go.Figure(
data=[
{"type": "scattergl", "marker": {"color": "green"}... | true | true |
1c39218de99cf3055114621cc77d6dfaa98a58d0 | 3,699 | py | Python | flask_apispec/apidoc.py | henryfjordan/flask-apispec | a643f15586f4fdc16372e939805d00a0b23eafe3 | [
"MIT"
] | null | null | null | flask_apispec/apidoc.py | henryfjordan/flask-apispec | a643f15586f4fdc16372e939805d00a0b23eafe3 | [
"MIT"
] | null | null | null | flask_apispec/apidoc.py | henryfjordan/flask-apispec | a643f15586f4fdc16372e939805d00a0b23eafe3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import copy
import six
from pkg_resources import parse_version
import apispec
from apispec.core import VALID_METHODS
from apispec.ext.marshmallow import swagger
from marshmallow import Schema
from marshmallow.utils import is_instance_or_subclass
from flask_apispec.paths import rule_to_path,... | 34.570093 | 86 | 0.641254 |
import copy
import six
from pkg_resources import parse_version
import apispec
from apispec.core import VALID_METHODS
from apispec.ext.marshmallow import swagger
from marshmallow import Schema
from marshmallow.utils import is_instance_or_subclass
from flask_apispec.paths import rule_to_path, rule_to_params
from fl... | true | true |
1c3926366b55551ae92b5873afdccbfc3221ebce | 4,769 | py | Python | src/main/python/main.py | sterzy/rc-snitch | 0e6889e1797c3eae2e5f502f7f01cfee7e1bfa20 | [
"MIT"
] | null | null | null | src/main/python/main.py | sterzy/rc-snitch | 0e6889e1797c3eae2e5f502f7f01cfee7e1bfa20 | [
"MIT"
] | null | null | null | src/main/python/main.py | sterzy/rc-snitch | 0e6889e1797c3eae2e5f502f7f01cfee7e1bfa20 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from commands import block, send, sniff, profile
from pathlib import Path
from util import check_binary, check_tri_state, check_tri_state_pair
import argparse
def main():
parser = argparse.ArgumentParser(description='''A utility to sniff and \
transmit with a 433MH... | 37.551181 | 82 | 0.477039 |
from commands import block, send, sniff, profile
from pathlib import Path
from util import check_binary, check_tri_state, check_tri_state_pair
import argparse
def main():
parser = argparse.ArgumentParser(description='''A utility to sniff and \
transmit with a 433MHz transceiver using an Arduino.''')
subpar... | true | true |
1c39284718027a242c5b3d74f179ac8b43a95aed | 9,481 | py | Python | tests/test_miso_helper.py | ferrumnet/MISO | d1698e1819d7cacbddb7fb979dc0c9a613d55cc9 | [
"Apache-2.0"
] | 80 | 2020-11-30T00:25:51.000Z | 2022-03-15T12:02:37.000Z | brownie/tests/test_miso_helper.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 8 | 2021-09-01T17:33:57.000Z | 2022-02-25T20:11:27.000Z | brownie/tests/test_miso_helper.py | Certora/miso | 9575fdf8aeccf1d97ba389b8428194e66187b6c1 | [
"Apache-2.0"
] | 30 | 2020-11-30T00:25:57.000Z | 2022-01-09T06:01:27.000Z | from brownie import accounts, web3, Wei, reverts, chain
from brownie.network.transaction import TransactionReceipt
from brownie.convert import to_address
import pytest
from brownie import Contract
from settings import *
from test_token_factory import _create_token
# reset the chain after every test case
@pytest.fixt... | 32.693103 | 136 | 0.702141 | from brownie import accounts, web3, Wei, reverts, chain
from brownie.network.transaction import TransactionReceipt
from brownie.convert import to_address
import pytest
from brownie import Contract
from settings import *
from test_token_factory import _create_token
@pytest.fixture(autouse=True)
def isolation(fn_isol... | true | true |
1c392b3f62972fca6f39a129839f79d030fd890e | 6,362 | py | Python | test/functional/feature_dersig.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/feature_dersig.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | test/functional/feature_dersig.py | knotcoin/knotcoin | 3f4ade4e2cabf94acd80bc043deec3d9a4209938 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2017 The Knotcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP66 (DER SIG).
Test that the DERSIG soft-fork activates at (regtest) height 1251.
"""
from te... | 41.311688 | 105 | 0.668029 |
from test_framework.test_framework import KnotcoinTestFramework
from test_framework.util import *
from test_framework.mininode import *
from test_framework.blocktools import create_coinbase, create_block
from test_framework.script import CScript
from io import BytesIO
DERSIG_HEIGHT = 1251
REJECT_INVALID = 16
RE... | true | true |
1c392d05cd539b3dbedd2273b39a258c3a351840 | 513 | py | Python | setup.py | robert-pathy/graphite-cleaner | fc6e59cf25307cad532c4323fb8d62372e7bffbd | [
"MIT"
] | null | null | null | setup.py | robert-pathy/graphite-cleaner | fc6e59cf25307cad532c4323fb8d62372e7bffbd | [
"MIT"
] | null | null | null | setup.py | robert-pathy/graphite-cleaner | fc6e59cf25307cad532c4323fb8d62372e7bffbd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='graphite-cleaner',
version='0.1.3',
description='Graphite Whisper stale database files remover',
author='Services Wroclaw Team',
author_email='svc-code@opera.com',
url='https://github.com/operasoftware/graphite-clea... | 25.65 | 64 | 0.674464 |
from setuptools import setup, find_packages
setup(
name='graphite-cleaner',
version='0.1.3',
description='Graphite Whisper stale database files remover',
author='Services Wroclaw Team',
author_email='svc-code@opera.com',
url='https://github.com/operasoftware/graphite-cleaner',
packages=fi... | true | true |
1c3930693a5c124be3065fafbd3e7b798d91134e | 2,211 | py | Python | tools/utils.py | mpfeppat/mpfeppat | 85ecf09a3d8c33177967ea404b2274b0d4f2d2df | [
"Apache-2.0"
] | 1 | 2016-02-10T10:41:27.000Z | 2016-02-10T10:41:27.000Z | tools/utils.py | mpfeppat/mpfeppat | 85ecf09a3d8c33177967ea404b2274b0d4f2d2df | [
"Apache-2.0"
] | null | null | null | tools/utils.py | mpfeppat/mpfeppat | 85ecf09a3d8c33177967ea404b2274b0d4f2d2df | [
"Apache-2.0"
] | null | null | null | """Some format conversion tools.
"""
from base64 import b64encode
from gmpy import mpz
from re import sub
# from gmpy2 import mpz, bit_length, f_divmod_2exp
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
b64toOct = {}
i = 0
for key in "ABCDEFGH":
b64toOct[key] = "0" + str(i)
i... | 22.793814 | 78 | 0.561284 |
from base64 import b64encode
from gmpy import mpz
from re import sub
ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
b64toOct = {}
i = 0
for key in "ABCDEFGH":
b64toOct[key] = "0" + str(i)
i += 1
for key in "IJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=":
b64to... | true | true |
1c393135d2924153274c5bf9832e7a13fb57ac31 | 751 | py | Python | app/core/tests/test_utils.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 13 | 2018-07-31T15:37:47.000Z | 2021-12-20T04:48:13.000Z | app/core/tests/test_utils.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 25 | 2019-12-10T20:03:48.000Z | 2022-03-11T23:26:11.000Z | app/core/tests/test_utils.py | PragmaticCoder/Linkedin-Analytics | a990b5cae02f0d758bc3123bde643d13a439efa3 | [
"MIT"
] | 4 | 2020-03-24T20:13:50.000Z | 2022-02-05T20:40:48.000Z | from django.contrib.auth import get_user_model
from django.test import TestCase
from core.models import MyProfile
from core.utils import content_file_name
class ContentFileTests(TestCase):
def setUp(self):
self.user = get_user_model().objects.create_user(
email="test@gmail.com",
... | 27.814815 | 89 | 0.679095 | from django.contrib.auth import get_user_model
from django.test import TestCase
from core.models import MyProfile
from core.utils import content_file_name
class ContentFileTests(TestCase):
def setUp(self):
self.user = get_user_model().objects.create_user(
email="test@gmail.com",
... | true | true |
1c393157c4d04005e6e3d429b955d205cafcbc5c | 2,939 | py | Python | code/utils/bbox_helper.py | cruiseresearchgroup/DroTrack | d2adb8d8ee6d142f89c16cd906c848903ba1617b | [
"MIT"
] | 13 | 2020-08-19T14:33:04.000Z | 2021-11-29T05:43:45.000Z | code/utils/bbox_helper.py | cruiseresearchgroup/DroTrack | d2adb8d8ee6d142f89c16cd906c848903ba1617b | [
"MIT"
] | 1 | 2021-06-12T04:51:17.000Z | 2022-02-22T09:43:17.000Z | code/utils/bbox_helper.py | cruiseresearchgroup/DroTrack | d2adb8d8ee6d142f89c16cd906c848903ba1617b | [
"MIT"
] | 1 | 2021-06-23T07:06:07.000Z | 2021-06-23T07:06:07.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 13:37:39 2020
@author: Ali Hamdi; ali.ali@rmit.edu.au
"""
from collections import OrderedDict
import cv2
import numpy as np
from scipy.spatial import distance
def intersection_over_union(boxA, boxB):
# determine the (x, y)-coordinates of the intersection rectangl... | 31.945652 | 89 | 0.595781 |
from collections import OrderedDict
import cv2
import numpy as np
from scipy.spatial import distance
def intersection_over_union(boxA, boxB):
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
interArea = max(0, xB - xA + 1) ... | true | true |
1c393288d85c3a10aa4301a9be8d466f103489b4 | 9,643 | py | Python | tests/api/test_datafeed.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 81 | 2015-01-13T15:16:43.000Z | 2021-11-12T20:51:56.000Z | tests/api/test_datafeed.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 1 | 2015-07-30T06:17:55.000Z | 2015-07-30T08:09:14.000Z | tests/api/test_datafeed.py | sirjamesmeddel-gitty/intuition | cd517e6b3b315a743eb4d0d0dc294e264ab913ce | [
"Apache-2.0"
] | 30 | 2015-03-26T11:55:46.000Z | 2021-07-22T22:16:39.000Z | '''
Tests for intuition.api.datafeed
'''
import unittest
from nose.tools import raises, ok_, eq_, nottest
import random
import pytz
import datetime as dt
import pandas as pd
import intuition.api.datafeed as datafeed
from intuition.data.universe import Market
from intuition.errors import InvalidDatafeed
import dna.test... | 33.023973 | 79 | 0.606139 |
import unittest
from nose.tools import raises, ok_, eq_, nottest
import random
import pytz
import datetime as dt
import pandas as pd
import intuition.api.datafeed as datafeed
from intuition.data.universe import Market
from intuition.errors import InvalidDatafeed
import dna.test_utils
class FakeBacktestDatasource(obj... | true | true |
1c3933380f57420b969ba2aa01d1a27d4b57408a | 7,501 | py | Python | synapse/rest/client/v1/directory.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | 2 | 2021-05-14T19:05:03.000Z | 2021-05-26T23:00:43.000Z | synapse/rest/client/v1/directory.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | synapse/rest/client/v1/directory.py | TheJJ/synapse | 1032393dfb0c865fc540539dfe649e7b1a32037a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-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 applicab... | 33.337778 | 83 | 0.639781 |
from twisted.internet import defer
from synapse.api.errors import AuthError, SynapseError, Codes
from synapse.types import RoomAlias
from synapse.http.servlet import parse_json_object_from_request
from .base import ClientV1RestServlet, client_path_patterns
import logging
logger = logging.getLogger(... | true | true |
1c39336bd345b134235dc43a104eb61b2d17024f | 2,809 | py | Python | keystone/contrib/endpoint_filter/backends/catalog_sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/contrib/endpoint_filter/backends/catalog_sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | keystone/contrib/endpoint_filter/backends/catalog_sql.py | ISCAS-VDI/keystone | 11af181c06d78026c89a873f62931558e80f3192 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 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 agreed to in... | 36.012821 | 75 | 0.632253 |
from oslo_config import cfg
from keystone.catalog.backends import sql
from keystone.common import dependency
from keystone.common import utils
CONF = cfg.CONF
@dependency.requires('catalog_api')
class EndpointFilterCatalog(sql.Catalog):
def get_v3_catalog(self, user_id, project_id):
subst... | true | true |
1c3933738fb207211f83be29cc0b87ab51a2cb7f | 133 | py | Python | 001-simple-tr/reahl/simple-tr/etc/web.config.py | craig-reahl/python-web-framework-comparison | 30c9d08f5c87b5b12bda7158108398092d6cad31 | [
"Apache-2.0"
] | null | null | null | 001-simple-tr/reahl/simple-tr/etc/web.config.py | craig-reahl/python-web-framework-comparison | 30c9d08f5c87b5b12bda7158108398092d6cad31 | [
"Apache-2.0"
] | null | null | null | 001-simple-tr/reahl/simple-tr/etc/web.config.py | craig-reahl/python-web-framework-comparison | 30c9d08f5c87b5b12bda7158108398092d6cad31 | [
"Apache-2.0"
] | 1 | 2018-10-23T07:46:51.000Z | 2018-10-23T07:46:51.000Z |
from __future__ import print_function, unicode_literals, absolute_import, division
from simple_tr import MyUI
web.site_root = MyUI
| 22.166667 | 82 | 0.842105 |
from __future__ import print_function, unicode_literals, absolute_import, division
from simple_tr import MyUI
web.site_root = MyUI
| true | true |
1c39356ff5ad1145eb7a03dbf131079e7de162ec | 907 | py | Python | taotao-cloud-python/taotao-cloud-oldboy/day59-student-manager-system-form/day59 - 1/day59/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 47 | 2021-04-13T10:32:13.000Z | 2022-03-31T10:30:30.000Z | taotao-cloud-python/taotao-cloud-oldboy/day59-student-manager-system-form/day59 - 1/day59/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:41:04.000Z | 2021-11-01T07:41:10.000Z | taotao-cloud-python/taotao-cloud-oldboy/day59-student-manager-system-form/day59 - 1/day59/urls.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 21 | 2021-04-13T10:32:17.000Z | 2022-03-26T07:43:22.000Z | """day59 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | 36.28 | 79 | 0.692393 | from django.conf.urls import url
from django.contrib import admin
from app01 import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^users/', views.users),
url(r'^add_user/', views.add_user),
url(r'^edit_user-(\d+)/', views.edit_user),
]
| true | true |
1c3935bd382124999fb78f579dec7c4c42f6c9cd | 685 | py | Python | pysparktest/test_data_frame.py | Joe-Heffer-Shef/pyspark-bessemer | ab78a96fd7fc607824a95a0b502d4ffa1bcc1899 | [
"MIT"
] | null | null | null | pysparktest/test_data_frame.py | Joe-Heffer-Shef/pyspark-bessemer | ab78a96fd7fc607824a95a0b502d4ffa1bcc1899 | [
"MIT"
] | 4 | 2021-04-08T09:38:59.000Z | 2021-04-08T10:03:27.000Z | pysparktest/test_data_frame.py | Joe-Heffer-Shef/pyspark-bessemer | ab78a96fd7fc607824a95a0b502d4ffa1bcc1899 | [
"MIT"
] | null | null | null | """
PySpark "Hello World" example
Based on the quick-start guide in the docs
https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html
"""
import datetime
import random
import uuid
from pyspark.sql import SparkSession
def test_data_frame(session: SparkSession):
# Create data frame
df ... | 26.346154 | 79 | 0.681752 |
import datetime
import random
import uuid
from pyspark.sql import SparkSession
def test_data_frame(session: SparkSession):
df = session.createDataFrame([
(i, random.random(), uuid.uuid4().hex,
datetime.date(1970, 1, 1) + datetime.timedelta(days=i),
datetime.datetime(1970,... | true | true |
1c3939db7a445b27d04bce0f50544a42aa0b8875 | 1,881 | py | Python | stanford_postagger/java.py | banyh/PyStanfordSegmenter | 2165a218df87f00f84c461a41ca77a86eb85687b | [
"MIT"
] | 16 | 2017-03-25T07:42:51.000Z | 2022-03-12T09:33:50.000Z | stanford_postagger/java.py | banyh/PyStanfordSegmenter | 2165a218df87f00f84c461a41ca77a86eb85687b | [
"MIT"
] | 1 | 2017-09-06T02:46:29.000Z | 2017-09-21T01:56:11.000Z | stanford_postagger/java.py | banyh/PyStanfordSegmenter | 2165a218df87f00f84c461a41ca77a86eb85687b | [
"MIT"
] | 5 | 2017-04-13T04:32:53.000Z | 2018-03-17T06:09:27.000Z | from jpype import startJVM, getDefaultJVMPath, shutdownJVM, java, JPackage, isJVMStarted
from os.path import join, dirname
from platform import system
class Postagger(object):
def __init__(self, lang='zh'):
if system() == 'Linux':
sep = ':'
else:
sep = ';' # Windows
... | 44.785714 | 105 | 0.577352 | from jpype import startJVM, getDefaultJVMPath, shutdownJVM, java, JPackage, isJVMStarted
from os.path import join, dirname
from platform import system
class Postagger(object):
def __init__(self, lang='zh'):
if system() == 'Linux':
sep = ':'
else:
sep = ';'
pwd = d... | true | true |
1c393ad1a362a095cadd38c4c328787fc28e2873 | 5,994 | py | Python | stuff7/utils/parsers/tests.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | stuff7/utils/parsers/tests.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | stuff7/utils/parsers/tests.py | Stuff7/stuff7 | c4210ad99c7d745ded3742a645cc9173243946b1 | [
"MIT"
] | null | null | null | from datetime import datetime as dt
from datetime import timezone as tz
from datetime import timedelta as td
from calendar import isleap
from unittest import TestCase
from pytz import timezone
from . import TimeDeltaParser, TimezoneParser
class TimeDeltaParserTestCase(TestCase):
def setUp(self):
self.delta = ... | 43.434783 | 110 | 0.66016 | from datetime import datetime as dt
from datetime import timezone as tz
from datetime import timedelta as td
from calendar import isleap
from unittest import TestCase
from pytz import timezone
from . import TimeDeltaParser, TimezoneParser
class TimeDeltaParserTestCase(TestCase):
def setUp(self):
self.delta = ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.