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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c34c2de6d64e8d4f28b0beeb9cb750fec80460d | 15,433 | py | Python | 2D/convert_raw_to_hdf5.py | basharbme/unet | 32aba391c280a6d4f371d0bb19c2f60f6945da6d | [
"Apache-2.0"
] | 1 | 2019-09-08T01:48:17.000Z | 2019-09-08T01:48:17.000Z | 2D/convert_raw_to_hdf5.py | motazsaad/unet | 85117087c1cb73c81a8eea4e127fae7cb47b4fe1 | [
"Apache-2.0"
] | null | null | null | 2D/convert_raw_to_hdf5.py | motazsaad/unet | 85117087c1cb73c81a8eea4e127fae7cb47b4fe1 | [
"Apache-2.0"
] | 2 | 2021-03-04T05:41:34.000Z | 2021-08-25T00:25:29.000Z | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 30.379921 | 80 | 0.671872 |
import os
import nibabel as nib
import numpy as np
from tqdm import tqdm
import h5py
import json
import argparse
parser = argparse.ArgumentParser(
description="Convert Decathlon raw Nifti data "
"(http://medicaldecathlon.com) "
"files to Numpy data files",
add_help=True, formatter_clas... | true | true |
1c34c4ccf9a41d12264f4a5d14ae65648867b3b4 | 5,589 | py | Python | exercises/adaboost_scenario.py | anatfl/IML.HUJI | b4a01e04fff4181837780cc603446fd73defd349 | [
"MIT"
] | null | null | null | exercises/adaboost_scenario.py | anatfl/IML.HUJI | b4a01e04fff4181837780cc603446fd73defd349 | [
"MIT"
] | null | null | null | exercises/adaboost_scenario.py | anatfl/IML.HUJI | b4a01e04fff4181837780cc603446fd73defd349 | [
"MIT"
] | null | null | null | import numpy as np
from typing import Tuple
from IMLearn.metalearners.adaboost import AdaBoost
from IMLearn.learners.classifiers.decision_stump import DecisionStump
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from IMLearn.metrics import accuracy
def generate_data(n:... | 39.359155 | 79 | 0.573985 | import numpy as np
from typing import Tuple
from IMLearn.metalearners.adaboost import AdaBoost
from IMLearn.learners.classifiers.decision_stump import DecisionStump
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from IMLearn.metrics import accuracy
def generate_data(n:... | true | true |
1c34c5350cb8380f5333eb172ccfc98c80642e43 | 37,617 | py | Python | networkx/classes/multidigraph.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | networkx/classes/multidigraph.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | null | null | null | networkx/classes/multidigraph.py | theaverageguy/networkx | b2b74b3ba028ef3788f796aa64b037c8ea446539 | [
"BSD-3-Clause"
] | 1 | 2020-09-11T06:41:14.000Z | 2020-09-11T06:41:14.000Z | """Base class for MultiDiGraph."""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph # for doc... | 36.170192 | 90 | 0.554962 |
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from networkx.classes.digraph import DiGraph
from networkx.classes.multigraph import MultiGraph
from networkx.exception import NetworkXError
__author__ = """\n""".join(['Aric Hagberg (hagberg@lanl.gov)',
... | true | true |
1c34c5bb98d299ddc609b34b925032366d6cf4dc | 2,290 | py | Python | ImageToAsciiApp/FileBrowser.py | MahirHamiAbrar/ImageToAsciiGui | 1a8dd3e0d8ff6bd6617085072e7afd3456495344 | [
"MIT"
] | null | null | null | ImageToAsciiApp/FileBrowser.py | MahirHamiAbrar/ImageToAsciiGui | 1a8dd3e0d8ff6bd6617085072e7afd3456495344 | [
"MIT"
] | null | null | null | ImageToAsciiApp/FileBrowser.py | MahirHamiAbrar/ImageToAsciiGui | 1a8dd3e0d8ff6bd6617085072e7afd3456495344 | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import *
# image filters
IMAGE_FILTERS = "JPG (*.jpg);;PNG (*.png);;JPEG (*.jpeg);;BPM (*.bmp);;CUR (*.cur);;GIF(*.gif);;Icons (*.ico);;PBM (" \
"*.pbm);;PGM (*.pgm);;PPM (*.ppm);;SVG (*.svg);;SVGZ (*.svgz);;TGA (*.tga);;TIF (*.tif);;TIFF (" \
"*.tiff);;WBMP (*... | 41.636364 | 120 | 0.665502 | from PyQt5.QtWidgets import *
IMAGE_FILTERS = "JPG (*.jpg);;PNG (*.png);;JPEG (*.jpeg);;BPM (*.bmp);;CUR (*.cur);;GIF(*.gif);;Icons (*.ico);;PBM (" \
"*.pbm);;PGM (*.pgm);;PPM (*.ppm);;SVG (*.svg);;SVGZ (*.svgz);;TGA (*.tga);;TIF (*.tif);;TIFF (" \
"*.tiff);;WBMP (*.wbmp);;WEBP (*.... | true | true |
1c34c5be33658e4821abcaee6fc9cbc907dce4bb | 506 | py | Python | tests/multisig/test_wallet.py | forest-friends/vyper-common-contracts | c541634e3d0752801ed06b8cf6dc0a7c59555fdd | [
"MIT"
] | null | null | null | tests/multisig/test_wallet.py | forest-friends/vyper-common-contracts | c541634e3d0752801ed06b8cf6dc0a7c59555fdd | [
"MIT"
] | null | null | null | tests/multisig/test_wallet.py | forest-friends/vyper-common-contracts | c541634e3d0752801ed06b8cf6dc0a7c59555fdd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import brownie
import pytest
from brownie.test import given, strategy
def test_(ZERO_ADDRESS, multisig_wallet, erc20_token, neo, morpheus, trinity):
erc20_token.transfer(multisig_wallet, 1_000, {'from': neo})
assert multisig_wallet.isSigner(neo, {'from': neo}) == True
assert multisig_... | 31.625 | 78 | 0.741107 |
import brownie
import pytest
from brownie.test import given, strategy
def test_(ZERO_ADDRESS, multisig_wallet, erc20_token, neo, morpheus, trinity):
erc20_token.transfer(multisig_wallet, 1_000, {'from': neo})
assert multisig_wallet.isSigner(neo, {'from': neo}) == True
assert multisig_wallet.isSigner(mo... | true | true |
1c34c672d99fd61ea3c34930f451006d82e22ba4 | 9,007 | py | Python | sdk/eventhub/azure-eventhubs/tests/test_send.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | sdk/eventhub/azure-eventhubs/tests/test_send.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | 1 | 2020-03-06T05:57:16.000Z | 2020-03-06T05:57:16.000Z | sdk/eventhub/azure-eventhubs/tests/test_send.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | # -- coding: utf-8 --
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#-----------------------------------------------------------------... | 33.483271 | 137 | 0.684135 |
import pytest
import time
import json
import sys
from azure.eventhub import EventData, EventHubClient, TransportType
@pytest.mark.liveTest
def test_send_with_partition_key(connstr_receivers):
connection_str, receivers = connstr_receivers
client = EventHubClient.from_connection_string(connection_str, n... | true | true |
1c34c748d1c78ea2bed204132d183f09310b1607 | 2,501 | py | Python | cms/plugins/text/managers.py | LUKKIEN/django-cms-2.0 | 0600cc1a3f3636a867faf0afe3719539fee36d69 | [
"BSD-3-Clause"
] | 1 | 2015-09-24T00:36:34.000Z | 2015-09-24T00:36:34.000Z | cms/plugins/text/managers.py | alamierda09/django-cms-2.0 | 0aba7f465730ae9a975ea6fd0bf5cac1ba70022c | [
"BSD-3-Clause"
] | null | null | null | cms/plugins/text/managers.py | alamierda09/django-cms-2.0 | 0aba7f465730ae9a975ea6fd0bf5cac1ba70022c | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from cms import settings
class ContentManager(models.Manager):
def sanitize(self, content):
"""
Sanitize the content to avoid XSS and so
"""
import html5lib
from html5lib import sanitizer
p = html5lib.HTMLParser(tokenizer=sanitizer.HTMLS... | 36.779412 | 84 | 0.582167 | from django.db import models
from cms import settings
class ContentManager(models.Manager):
def sanitize(self, content):
import html5lib
from html5lib import sanitizer
p = html5lib.HTMLParser(tokenizer=sanitizer.HTMLSanitizer)
return p.parse(content).toxml()[19:-14]
d... | true | true |
1c34c7a45b0d20451d4f4140a98ded921a574d17 | 6,553 | py | Python | toontown/safezone/Train.py | TopDeveloper-333/opentoontownsrc | b2d956d1a40f5e3d40fa33a9f01862137e018347 | [
"BSD-3-Clause"
] | null | null | null | toontown/safezone/Train.py | TopDeveloper-333/opentoontownsrc | b2d956d1a40f5e3d40fa33a9f01862137e018347 | [
"BSD-3-Clause"
] | null | null | null | toontown/safezone/Train.py | TopDeveloper-333/opentoontownsrc | b2d956d1a40f5e3d40fa33a9f01862137e018347 | [
"BSD-3-Clause"
] | null | null | null | from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import globalClockDelta
from direct.distributed.ClockDelta import NetworkTimePrecision
import random
from direct.task.Task import Task
from direct.direc... | 40.202454 | 351 | 0.653746 | from pandac.PandaModules import *
from direct.showbase.DirectObject import DirectObject
from direct.interval.IntervalGlobal import *
from direct.distributed.ClockDelta import globalClockDelta
from direct.distributed.ClockDelta import NetworkTimePrecision
import random
from direct.task.Task import Task
from direct.direc... | true | true |
1c34c8486e902d19a0204e46246c26fb3c57d4bf | 50,181 | py | Python | third_party/stdlib/threading.py | wangwansan/grumpy | aff3b3ff62a34c5baa9783307764f640df021337 | [
"Apache-2.0"
] | 11,252 | 2017-01-04T16:19:12.000Z | 2022-03-31T13:42:31.000Z | third_party/stdlib/threading.py | wangwansan/grumpy | aff3b3ff62a34c5baa9783307764f640df021337 | [
"Apache-2.0"
] | 301 | 2017-01-04T17:34:00.000Z | 2022-03-15T21:40:21.000Z | third_party/stdlib/threading.py | wangwansan/grumpy | aff3b3ff62a34c5baa9783307764f640df021337 | [
"Apache-2.0"
] | 819 | 2017-01-04T17:26:26.000Z | 2022-03-20T14:11:28.000Z | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from collections import deque as _deque
from itertools import count as _count
from time import time as _time, sleep as _sleep
from ... | 35.463604 | 99 | 0.607122 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
try:
import thread
except ImportError:
del _sys.modules[__name__]
raise
import warnings
from collections import deque as _deque
from itertools import count as _count
from time import time as _time, sleep as _sleep
from ... | false | true |
1c34c92caf91c8570e69cf420d1b129bb655d0c2 | 3,026 | py | Python | meiduo_mall/apps/users/migrations/0001_initial.py | liusudo123/meiduo_project | 3bf92fff56bf47777795cf9078ff285eb004b81f | [
"MIT"
] | null | null | null | meiduo_mall/apps/users/migrations/0001_initial.py | liusudo123/meiduo_project | 3bf92fff56bf47777795cf9078ff285eb004b81f | [
"MIT"
] | null | null | null | meiduo_mall/apps/users/migrations/0001_initial.py | liusudo123/meiduo_project | 3bf92fff56bf47777795cf9078ff285eb004b81f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2019-09-14 13:02
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 63.041667 | 329 | 0.66226 |
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_lengt... | true | true |
1c34c9b865395cd62782cc35121c5f483620250d | 3,628 | py | Python | Chapters/05.OptimalTransport/color_transfer.py | MichielStock/SelectedTopicsOptimization | 20f6b37566d23cdde0ac6b765ffcc5ed72a11172 | [
"MIT"
] | 22 | 2017-03-21T14:01:10.000Z | 2022-03-02T18:51:40.000Z | Chapters/05.OptimalTransport/color_transfer.py | ntienvu/SelectedTopicsOptimization | 069659ca9754cc7fd884b654a06157cc7da6f963 | [
"MIT"
] | 2 | 2018-03-22T09:54:01.000Z | 2018-05-30T16:16:53.000Z | Chapters/05.OptimalTransport/color_transfer.py | ntienvu/SelectedTopicsOptimization | 069659ca9754cc7fd884b654a06157cc7da6f963 | [
"MIT"
] | 18 | 2018-01-21T15:23:51.000Z | 2022-02-05T20:12:03.000Z | """
Created on Sunday 28 January 2018
Last update: Sunday 11 March 2018
@author: Michiel Stock
michielfmstock@gmail.com
Module for transfering the color between two images
"""
from optimal_transport import compute_optimal_transport
import numpy as np
from skimage import io
from sklearn.cluster import MiniBatchKMeans... | 32.392857 | 80 | 0.681367 |
from optimal_transport import compute_optimal_transport
import numpy as np
from skimage import io
from sklearn.cluster import MiniBatchKMeans as KMeans
from sklearn.preprocessing import StandardScaler
from collections import Counter
from sklearn.metrics.pairwise import pairwise_distances
import matplotlib.pyplot as pl... | true | true |
1c34c9fa5fe1b95f7e9cd0f18647a64aab0822d1 | 5,032 | py | Python | python/language_pairs.py | Software-Engineering-Group-4-Maamy/chat-bot | bd3635324367a8edb72c73eba35d08231f440a50 | [
"MIT"
] | 1 | 2022-02-26T23:25:11.000Z | 2022-02-26T23:25:11.000Z | python/language_pairs.py | Software-Engineering-Group-4-Maamy/chat-bot | bd3635324367a8edb72c73eba35d08231f440a50 | [
"MIT"
] | 2 | 2022-02-25T21:29:40.000Z | 2022-02-26T20:07:02.000Z | python/language_pairs.py | Software-Engineering-Group-4-Maamy/chat-bot | bd3635324367a8edb72c73eba35d08231f440a50 | [
"MIT"
] | 2 | 2022-02-11T21:05:26.000Z | 2022-03-03T00:27:03.000Z | """All the input and responses that the chatbot can receive and give"""
pairs = [
[
r"my name is (.*)|my name|(.*) my name|my name (.*)",
["Hello, how are you feeling today?", ]
],
[
r"i am a bit concern about this recent stock market fiasco|concerned stock market|(.*) conce... | 36.729927 | 147 | 0.534181 | pairs = [
[
r"my name is (.*)|my name|(.*) my name|my name (.*)",
["Hello, how are you feeling today?", ]
],
[
r"i am a bit concern about this recent stock market fiasco|concerned stock market|(.*) concerned stock market|concerned stock market (.*)",
["Do not be alar... | true | true |
1c34ca8e9b8d28b4024fe490f6d49900ca62b44a | 1,875 | py | Python | 2021/day4.py | omad/adventofcode | 685be8f6c12f192093654a6f822ed535a7687314 | [
"Apache-2.0"
] | null | null | null | 2021/day4.py | omad/adventofcode | 685be8f6c12f192093654a6f822ed535a7687314 | [
"Apache-2.0"
] | null | null | null | 2021/day4.py | omad/adventofcode | 685be8f6c12f192093654a6f822ed535a7687314 | [
"Apache-2.0"
] | null | null | null |
data = """\
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 17 24 4
10 16 15 9 19
18 8 23 26 20
22 11 13 6 5
2 0 12 3 7
"""
fr... | 22.865854 | 70 | 0.532267 |
data = """\
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 17 24 4
10 16 15 9 19
18 8 23 26 20
22 11 13 6 5
2 0 12 3 7
"""
fr... | true | true |
1c34cb237ef74e7ad54998c960c93a7fdffe5213 | 464 | py | Python | examples/datasets/plot_mauna_loa.py | ltiao/scribbles | 9f30ea92ee348154568a7791751634d1feaba774 | [
"MIT"
] | 1 | 2020-03-01T04:36:36.000Z | 2020-03-01T04:36:36.000Z | examples/datasets/plot_mauna_loa.py | ltiao/scribbles | 9f30ea92ee348154568a7791751634d1feaba774 | [
"MIT"
] | 3 | 2020-01-02T19:09:40.000Z | 2020-01-02T19:11:02.000Z | examples/datasets/plot_mauna_loa.py | ltiao/scribbles | 9f30ea92ee348154568a7791751634d1feaba774 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Mauna Loa Atmospheric Carbon Dioxide
====================================
Hello world
"""
# sphinx_gallery_thumbnail_number = 1
import seaborn as sns
from scribbles.datasets import mauna_loa_load_dataframe
# %%
data = mauna_loa_load_dataframe(base_dir="../../datasets")
g = sns.relplot(... | 22.095238 | 59 | 0.62931 |
import seaborn as sns
from scribbles.datasets import mauna_loa_load_dataframe
data = mauna_loa_load_dataframe(base_dir="../../datasets")
g = sns.relplot(x='date', y='average', kind="line",
data=data, height=5, aspect=1.5, alpha=0.8)
g.set_ylabels(r"average $\mathrm{CO}_2$ (ppm)")
| true | true |
1c34cb446d62086842a777d8d83eb336a2392db7 | 8,795 | py | Python | src/models/semseg.py | hrdipto/COVID19-L3-Net | 7450defa1276da8684caadb1631bd6850efb51cb | [
"Apache-2.0"
] | 38 | 2020-05-12T21:26:45.000Z | 2022-03-18T02:36:28.000Z | src/models/semseg.py | UBC-CIC/vgh-covid-19-ct-model | 3ae2bba16c2ab0d96650e790dc2e6b896c377183 | [
"Apache-2.0"
] | 5 | 2020-05-14T07:45:14.000Z | 2021-09-04T20:43:26.000Z | src/models/semseg.py | UBC-CIC/vgh-covid-19-ct-model | 3ae2bba16c2ab0d96650e790dc2e6b896c377183 | [
"Apache-2.0"
] | 9 | 2020-05-14T12:02:03.000Z | 2021-06-25T21:21:59.000Z | import torch
import torch.nn.functional as F
import torchvision
from torchvision import transforms
import os
import tqdm
import pylab as plt
import numpy as np
import scipy.sparse as sps
from collections.abc import Sequence
import time
from src import utils as ut
from sklearn.metrics import confusion_matrix
import skim... | 34.490196 | 101 | 0.579648 | import torch
import torch.nn.functional as F
import torchvision
from torchvision import transforms
import os
import tqdm
import pylab as plt
import numpy as np
import scipy.sparse as sps
from collections.abc import Sequence
import time
from src import utils as ut
from sklearn.metrics import confusion_matrix
import skim... | true | true |
1c34cb8e2bd8167a9cdbac34f2eaaeef897cbeb7 | 388 | py | Python | toontown/town/TTStreet.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 99 | 2019-11-02T22:25:00.000Z | 2022-02-03T03:48:00.000Z | toontown/town/TTStreet.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 42 | 2019-11-03T05:31:08.000Z | 2022-03-16T22:50:32.000Z | toontown/town/TTStreet.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 57 | 2019-11-03T07:47:37.000Z | 2022-03-22T00:41:49.000Z | from . import Street
class TTStreet(Street.Street):
def __init__(self, loader, parentFSM, doneEvent):
Street.Street.__init__(self, loader, parentFSM, doneEvent)
def load(self):
Street.Street.load(self)
def unload(self):
Street.Street.unload(self)
def doRequestLeave(self, req... | 24.25 | 66 | 0.680412 | from . import Street
class TTStreet(Street.Street):
def __init__(self, loader, parentFSM, doneEvent):
Street.Street.__init__(self, loader, parentFSM, doneEvent)
def load(self):
Street.Street.load(self)
def unload(self):
Street.Street.unload(self)
def doRequestLeave(self, req... | true | true |
1c34cc223bf419de2c83c0b3f2d4778cddf99416 | 15,003 | py | Python | lib/sqlalchemy/orm/base.py | lelit/sqlalchemy | 55f930ef3d4e60bed02a2dad16e331fe42cfd12b | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/base.py | lelit/sqlalchemy | 55f930ef3d4e60bed02a2dad16e331fe42cfd12b | [
"MIT"
] | null | null | null | lib/sqlalchemy/orm/base.py | lelit/sqlalchemy | 55f930ef3d4e60bed02a2dad16e331fe42cfd12b | [
"MIT"
] | null | null | null | # orm/base.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Constants and rudimental functions used throughout the ORM.
"""
import operator
fr... | 26.274956 | 79 | 0.680264 |
import operator
from . import exc
from .. import exc as sa_exc
from .. import inspection
from .. import util
from ..sql import expression
PASSIVE_NO_RESULT = util.symbol(
"PASSIVE_NO_RESULT",
"""Symbol returned by a loader callable or other attribute/history
retrieval operation when a value could... | true | true |
1c34ceeb7a442ca69c61d8058ac79407b2094fbd | 2,951 | py | Python | .travis-pre-run.py | PaulGregor/evelink | dc1ca05725bf81c7f066cf4abcb51ab503759aaa | [
"MIT"
] | null | null | null | .travis-pre-run.py | PaulGregor/evelink | dc1ca05725bf81c7f066cf4abcb51ab503759aaa | [
"MIT"
] | null | null | null | .travis-pre-run.py | PaulGregor/evelink | dc1ca05725bf81c7f066cf4abcb51ab503759aaa | [
"MIT"
] | 1 | 2019-12-11T10:31:09.000Z | 2019-12-11T10:31:09.000Z | #!/usr/bin/env python
#
# Download and extract the last Google App Engine SDK.
#
import argparse
import logging
import os
import re
import sys
import urllib
import urllib2
from xml.etree import ElementTree as ET
from zipfile import ZipFile
GAE_FEED_URL = 'https://code.google.com/feeds/p/googleappengine/downloads/b... | 27.839623 | 88 | 0.624873 |
import argparse
import logging
import os
import re
import sys
import urllib
import urllib2
from xml.etree import ElementTree as ET
from zipfile import ZipFile
GAE_FEED_URL = 'https://code.google.com/feeds/p/googleappengine/downloads/basic'
SDK_PATTERN = r'http://googleappengine.googlecode.com/files/google_appeng... | true | true |
1c34d05d5d36ccf8a7f171a2d3292af74ed9be9f | 1,140 | bzl | Python | sdk/bazel/base/common/build_defs/package_info.bzl | OpenTrustGroup/scripts | 31ca2ca5bae055113c6f92a2eb75b0c7528902b3 | [
"BSD-3-Clause"
] | 49 | 2018-12-20T00:35:06.000Z | 2021-12-30T22:40:05.000Z | build_defs/package_info.bzl | gxbllm/Fuchsia-SDK | 869668003f20d560a40802c7d820ef0fefba0462 | [
"BSD-3-Clause"
] | null | null | null | build_defs/package_info.bzl | gxbllm/Fuchsia-SDK | 869668003f20d560a40802c7d820ef0fefba0462 | [
"BSD-3-Clause"
] | 21 | 2019-01-03T11:06:10.000Z | 2021-08-06T00:55:50.000Z | # Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Some utilities to declare and aggregate package contents.
"""
PackageLocalInfo = provider(
fields = {
"mappings": "list of (package dest, sou... | 30 | 80 | 0.672807 |
PackageLocalInfo = provider(
fields = {
"mappings": "list of (package dest, source) pairs",
},
)
PackageGeneratedInfo = provider(
fields = {
"mappings": "list of (package dest, source) pairs",
},
)
PackageAggregateInfo = provider(
fields = {
"contents": "depset of (... | true | true |
1c34d062cc2c268b11c9bdab083cd46cb4cdf8a3 | 284 | py | Python | projectamber/amberapp/migrations/0002_delete_order.py | AIexBondar/my_works | 0ba56e64bffb2e89d760861264c73417bc9f14fa | [
"Apache-2.0"
] | null | null | null | projectamber/amberapp/migrations/0002_delete_order.py | AIexBondar/my_works | 0ba56e64bffb2e89d760861264c73417bc9f14fa | [
"Apache-2.0"
] | null | null | null | projectamber/amberapp/migrations/0002_delete_order.py | AIexBondar/my_works | 0ba56e64bffb2e89d760861264c73417bc9f14fa | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-29 17:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('amberapp', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='Order',
),
]
| 16.705882 | 47 | 0.588028 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('amberapp', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='Order',
),
]
| true | true |
1c34d10223b3137fe7be6b9ddfaf0cd25c9c2e03 | 5,310 | py | Python | steps/meta/train_sat_maml.py | ondrejklejch/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 18 | 2019-10-24T04:42:16.000Z | 2021-11-24T03:07:59.000Z | steps/meta/train_sat_maml.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | null | null | null | steps/meta/train_sat_maml.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 4 | 2018-08-31T01:08:50.000Z | 2019-05-10T12:12:57.000Z | import sys
import numpy as np
from keras import backend as K
from keras.callbacks import Callback, ModelCheckpoint, CSVLogger, LearningRateScheduler, TensorBoard
from keras.layers import Input, Activation, Conv1D, BatchNormalization
from keras.models import load_model, Model
from keras.optimizers import Adam
from lea... | 37.928571 | 167 | 0.705461 | import sys
import numpy as np
from keras import backend as K
from keras.callbacks import Callback, ModelCheckpoint, CSVLogger, LearningRateScheduler, TensorBoard
from keras.layers import Input, Activation, Conv1D, BatchNormalization
from keras.models import load_model, Model
from keras.optimizers import Adam
from lea... | false | true |
1c34d10e4992ef19bbf760081e0661f2f5b585d7 | 1,557 | py | Python | leetcode/933.number-of-recent-calls.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 177 | 2017-08-21T08:57:43.000Z | 2020-06-22T03:44:22.000Z | leetcode/933.number-of-recent-calls.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 2 | 2018-09-06T13:39:12.000Z | 2019-06-03T02:54:45.000Z | leetcode/933.number-of-recent-calls.py | geemaple/algorithm | 68bc5032e1ee52c22ef2f2e608053484c487af54 | [
"MIT"
] | 23 | 2017-08-23T06:01:28.000Z | 2020-04-20T03:17:36.000Z | #
# [969] Number of Recent Calls
#
# https://leetcode.com/problems/number-of-recent-calls/description/
#
# algorithms
# Easy (59.00%)
# Total Accepted: 37.2K
# Total Submissions: 52.8K
# Testcase Example: '["RecentCounter","ping","ping","ping","ping"]\n[[],[1],[100],[3001],[3002]]'
#
# Write a class RecentCounter t... | 22.242857 | 98 | 0.619782 |
import collections
class RecentCounter(object):
def __init__(self):
self.queue = collections.deque()
def ping(self, t):
self.queue.append(t)
while self.queue[0] < t - 3000:
self.queue.popleft()
ret... | true | true |
1c34d1ec56167ffacc5442ad9ae1e5b20e005a87 | 6,097 | py | Python | tests/unit/api/test_query.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | 2 | 2019-07-18T22:43:49.000Z | 2020-03-09T03:27:41.000Z | tests/unit/api/test_query.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | 20 | 2019-02-27T19:08:03.000Z | 2021-06-22T16:47:32.000Z | tests/unit/api/test_query.py | amenezes/discovery-client | 9c41456d1cc14f4aab34628ad4e13423e00bc4be | [
"Apache-2.0"
] | null | null | null | import pytest
from discovery import api
def sample_payload():
return {
"Name": "my-query",
"Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
"Token": "",
"Service": {
"Service": "redis",
"Failover": {"NearestN": 3, "Datacenters": ["dc1", "dc2"]},
... | 32.089474 | 82 | 0.507627 | import pytest
from discovery import api
def sample_payload():
return {
"Name": "my-query",
"Session": "adf4238a-882b-9ddc-4a9d-5b6758e4159e",
"Token": "",
"Service": {
"Service": "redis",
"Failover": {"NearestN": 3, "Datacenters": ["dc1", "dc2"]},
... | true | true |
1c34d24a7ccafb22e1865bc1b32325f00e7e88a9 | 4,243 | py | Python | src/main/run_work.py | ta-assistant/Admin-CLI | 1c03ede0e09d8ddc270646937aa7af463c55f1f5 | [
"MIT"
] | 1 | 2021-07-22T15:43:02.000Z | 2021-07-22T15:43:02.000Z | src/main/run_work.py | ta-assistant/Admin-CLI | 1c03ede0e09d8ddc270646937aa7af463c55f1f5 | [
"MIT"
] | 28 | 2021-05-15T08:18:21.000Z | 2021-08-02T06:12:30.000Z | src/main/run_work.py | ta-assistant/TA-CLI | 1c03ede0e09d8ddc270646937aa7af463c55f1f5 | [
"MIT"
] | null | null | null | import os
import json
# import pandas as pd
from datetime import datetime
from src.main.pre_work import Work
from lib.file_management.extract import unzipfile
from src.main.student_data import StudentData
from lib.file_management.configeditor import ConfigEditor
from lib.function_network.func_network import CallApi
fro... | 31.664179 | 130 | 0.651897 | import os
import json
from datetime import datetime
from src.main.pre_work import Work
from lib.file_management.extract import unzipfile
from src.main.student_data import StudentData
from lib.file_management.configeditor import ConfigEditor
from lib.function_network.func_network import CallApi
from lib.file_management... | true | true |
1c34d32afeb26bdca540b86539fcbc303eed4360 | 3,224 | py | Python | examples/aiohttp-echo/app.py | naotokuwa/line-bot-sdk-python | 5ce92703031d60e8b662ccc370699e09bd57999f | [
"Apache-2.0"
] | 1,563 | 2016-10-14T04:32:49.000Z | 2022-03-31T06:34:17.000Z | examples/aiohttp-echo/app.py | naotokuwa/line-bot-sdk-python | 5ce92703031d60e8b662ccc370699e09bd57999f | [
"Apache-2.0"
] | 265 | 2016-10-15T08:25:51.000Z | 2022-03-31T02:07:15.000Z | examples/aiohttp-echo/app.py | naotokuwa/line-bot-sdk-python | 5ce92703031d60e8b662ccc370699e09bd57999f | [
"Apache-2.0"
] | 999 | 2016-10-15T07:47:55.000Z | 2022-03-29T05:15:12.000Z | # -*- coding: utf-8 -*-
# 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,... | 30.415094 | 80 | 0.702543 |
import os
import sys
from argparse import ArgumentParser
import asyncio
import aiohttp
from aiohttp import web
import logging
from aiohttp.web_runner import TCPSite
from linebot import (
AsyncLineBotApi, WebhookParser
)
from linebot.aiohttp_async_http_client import AiohttpAsyncHttpClient
from line... | true | true |
1c34d36382b3db437c481582c544481af1042439 | 393 | py | Python | dtinyurl/wsgi.py | kawww/linkipfs | d9cd3109522d6c63e32a6b86edfe31546cca694a | [
"MIT"
] | 21 | 2019-06-16T08:58:00.000Z | 2022-01-24T02:36:55.000Z | dtinyurl/wsgi.py | kawww/linkipfs | d9cd3109522d6c63e32a6b86edfe31546cca694a | [
"MIT"
] | 5 | 2019-08-24T01:55:14.000Z | 2021-06-10T21:26:40.000Z | dtinyurl/wsgi.py | kawww/linkipfs | d9cd3109522d6c63e32a6b86edfe31546cca694a | [
"MIT"
] | 11 | 2019-06-16T08:58:33.000Z | 2021-10-06T03:50:28.000Z | """
WSGI config for dtinyurl project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dtinyurl.settings')
application = get_wsgi_application()
| true | true |
1c34d45292a58e17b560f9af3b64e2dde13af5cc | 1,180 | py | Python | ps1-fractals/p5-sierpinski-random/sierpinski.py | slhshamloo/comp-phys | 04d6759e0eb9d7e16e2781417d389bc15e22b01b | [
"MIT"
] | null | null | null | ps1-fractals/p5-sierpinski-random/sierpinski.py | slhshamloo/comp-phys | 04d6759e0eb9d7e16e2781417d389bc15e22b01b | [
"MIT"
] | null | null | null | ps1-fractals/p5-sierpinski-random/sierpinski.py | slhshamloo/comp-phys | 04d6759e0eb9d7e16e2781417d389bc15e22b01b | [
"MIT"
] | null | null | null | from numpy import ndarray
from fractal import fractal_random_scalerot
def sierpinski_random(range_x: tuple[float, float],
range_y: tuple[float, float],
steps: int = 10, samples: int=10000
) -> tuple[ndarray, ndarray]:
"""Generates the points of a s... | 39.333333 | 76 | 0.616102 | from numpy import ndarray
from fractal import fractal_random_scalerot
def sierpinski_random(range_x: tuple[float, float],
range_y: tuple[float, float],
steps: int = 10, samples: int=10000
) -> tuple[ndarray, ndarray]:
return fractal_random_scalerot... | true | true |
1c34d472e7497f77c5212b1ae5ceefbc7855012c | 409 | py | Python | django_tgbot/types/pollanswer.py | purwowd/django-tgbot | 6712ad2e9986c0961ad402a1d2e37be39e2f5fb4 | [
"MIT"
] | 52 | 2020-04-05T11:06:21.000Z | 2022-03-21T05:29:15.000Z | django_tgbot/types/pollanswer.py | armanexplorer/django-tgbot | e89f34b6a25beb9473c9e162ec8c161c14cd4cd6 | [
"MIT"
] | 11 | 2020-09-02T00:24:13.000Z | 2022-03-22T06:09:36.000Z | django_tgbot/types/pollanswer.py | armanexplorer/django-tgbot | e89f34b6a25beb9473c9e162ec8c161c14cd4cd6 | [
"MIT"
] | 14 | 2020-09-01T23:31:54.000Z | 2022-01-30T07:03:52.000Z | from . import BasicType
class PollAnswer(BasicType):
fields = {
'poll_id': str,
'option_ids': {
'class': int,
'array': True
},
}
def __init__(self, obj=None):
super(PollAnswer, self).__init__(obj)
def get_user(self):
return getattr(self... | 17.041667 | 45 | 0.552567 | from . import BasicType
class PollAnswer(BasicType):
fields = {
'poll_id': str,
'option_ids': {
'class': int,
'array': True
},
}
def __init__(self, obj=None):
super(PollAnswer, self).__init__(obj)
def get_user(self):
return getattr(self... | true | true |
1c34d4bcd55d7bb1e7174aa0d6409ab0baded1c4 | 737 | py | Python | django_redis_prometheus/cache/backends/filebased.py | Zagrebelin/django-redis-prometheus | 971a81f1cab91d62bca6223feb32506a764c246b | [
"Apache-2.0"
] | null | null | null | django_redis_prometheus/cache/backends/filebased.py | Zagrebelin/django-redis-prometheus | 971a81f1cab91d62bca6223feb32506a764c246b | [
"Apache-2.0"
] | null | null | null | django_redis_prometheus/cache/backends/filebased.py | Zagrebelin/django-redis-prometheus | 971a81f1cab91d62bca6223feb32506a764c246b | [
"Apache-2.0"
] | 1 | 2021-12-27T09:56:59.000Z | 2021-12-27T09:56:59.000Z | from django.core.cache.backends import filebased
from django_redis_prometheus.cache.metrics import (
django_cache_get_total, django_cache_hits_total, django_cache_misses_total)
class FileBasedCache(filebased.FileBasedCache):
"""Inherit filebased cache to add metrics about hit/miss ratio"""
def get(self, ... | 40.944444 | 79 | 0.720488 | from django.core.cache.backends import filebased
from django_redis_prometheus.cache.metrics import (
django_cache_get_total, django_cache_hits_total, django_cache_misses_total)
class FileBasedCache(filebased.FileBasedCache):
def get(self, key, default=None, version=None):
django_cache_get_total.label... | true | true |
1c34db27bfb6729e6ad1f4da9b23cb1c70234a26 | 9,244 | py | Python | indra/util/__init__.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 136 | 2016-02-11T22:06:37.000Z | 2022-03-31T17:26:20.000Z | indra/util/__init__.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 748 | 2016-02-03T16:27:56.000Z | 2022-03-09T14:27:54.000Z | indra/util/__init__.py | zebulon2/indra | 7727ddcab52ad8012eb6592635bfa114e904bd48 | [
"BSD-2-Clause"
] | 56 | 2015-08-28T14:03:44.000Z | 2022-02-04T06:15:55.000Z | import sys
import csv
import gzip
import zlib
import logging
from io import BytesIO
from functools import wraps
from datetime import datetime
import xml.etree.ElementTree as ET
try: # Python 3
from itertools import zip_longest
except ImportError: # Python 2
from itertools import izip_longest as zip_longest
... | 35.968872 | 82 | 0.589247 | import sys
import csv
import gzip
import zlib
import logging
from io import BytesIO
from functools import wraps
from datetime import datetime
import xml.etree.ElementTree as ET
try:
from itertools import zip_longest
except ImportError:
from itertools import izip_longest as zip_longest
if sys.version_info[... | true | true |
1c34dca3680ee63727932c6dfd78eef663f1094f | 3,405 | py | Python | src/streamlink/plugins/vk.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | 1 | 2022-02-25T20:14:03.000Z | 2022-02-25T20:14:03.000Z | src/streamlink/plugins/vk.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/vk.py | kyldery/streamlink | ef36240408c194a543557fb31e4535b0426ec153 | [
"BSD-2-Clause"
] | 12 | 2022-01-30T23:34:18.000Z | 2022-03-26T17:09:43.000Z | """
$description Russian live streaming and video hosting social platform.
$url vk.com
$type live, vod
"""
import logging
import re
from urllib.parse import parse_qsl, unquote, urlparse
from streamlink.exceptions import NoStreamsError
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.pl... | 31.238532 | 121 | 0.536564 |
import logging
import re
from urllib.parse import parse_qsl, unquote, urlparse
from streamlink.exceptions import NoStreamsError
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.dash import DASHStream
from streamlink.stream.hls import HL... | true | true |
1c34dd7b506455c31f7c2a55853c832f54a3c189 | 1,367 | py | Python | src/transit_processor.py | ebuka-o/TransitTime | e70f7717d4bfc94d9388326f3e85b29a1495e5b8 | [
"MIT"
] | null | null | null | src/transit_processor.py | ebuka-o/TransitTime | e70f7717d4bfc94d9388326f3e85b29a1495e5b8 | [
"MIT"
] | null | null | null | src/transit_processor.py | ebuka-o/TransitTime | e70f7717d4bfc94d9388326f3e85b29a1495e5b8 | [
"MIT"
] | null | null | null | import sys, getopt
from data_manager import DataManager
def print_welcome_messaage():
welcome_message ="""
******************************************************************
Welcome to TransitTime!
************************************************... | 29.085106 | 90 | 0.514996 | import sys, getopt
from data_manager import DataManager
def print_welcome_messaage():
welcome_message ="""
******************************************************************
Welcome to TransitTime!
************************************************... | true | true |
1c34de3969c41b53bd7ad03958021791317136dd | 150 | py | Python | Exam_18_04_2021/exam-skeleton/project/deliveries/food.py | Beshkov/OOP | 297edadb3e7801dfeee5752a20aae6aead8da610 | [
"MIT"
] | 1 | 2021-05-24T17:51:53.000Z | 2021-05-24T17:51:53.000Z | Exam_18_04_2021/exam-skeleton/project/deliveries/food.py | Beshkov/Python_OOP | 297edadb3e7801dfeee5752a20aae6aead8da610 | [
"MIT"
] | null | null | null | Exam_18_04_2021/exam-skeleton/project/deliveries/food.py | Beshkov/Python_OOP | 297edadb3e7801dfeee5752a20aae6aead8da610 | [
"MIT"
] | null | null | null | from project.deliveries.product import Product
class Food(Product):
def __init__(self, name):
super().__init__(name=name, quantity=15)
| 18.75 | 48 | 0.713333 | from project.deliveries.product import Product
class Food(Product):
def __init__(self, name):
super().__init__(name=name, quantity=15)
| true | true |
1c34dfb573fdfd4135ba26acd6db46609bd93a4d | 2,880 | py | Python | src/fuzzingtool/decorators/plugin_meta.py | NESCAU-UFLA/FuzzingTool | d0dbe3ee4c17ec8ee72423bf7fabce6849e01807 | [
"MIT"
] | 131 | 2020-12-14T18:45:29.000Z | 2022-03-31T03:00:21.000Z | src/fuzzingtool/decorators/plugin_meta.py | NESCAU-UFLA/FuzzingTool | d0dbe3ee4c17ec8ee72423bf7fabce6849e01807 | [
"MIT"
] | 51 | 2020-12-14T16:02:38.000Z | 2022-03-31T18:47:12.000Z | src/fuzzingtool/decorators/plugin_meta.py | NESCAU-UFLA/FuzzingTool | d0dbe3ee4c17ec8ee72423bf7fabce6849e01807 | [
"MIT"
] | 38 | 2020-12-14T21:12:18.000Z | 2022-03-29T18:23:20.000Z | # Copyright (c) 2020 - present Vitor Oriel <https://github.com/VitorOriel>
#
# 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 ... | 53.333333 | 133 | 0.703819 |
from ..core.plugins.Plugin import Plugin
def plugin_meta(cls: Plugin) -> Plugin:
metadata = ['__author__', '__params__', '__desc__', '__type__', '__version__']
classAttr = vars(cls)
for meta in metadata:
if meta not in classAttr:
raise Exception(f"Metadata {meta} not... | true | true |
1c34e0bcadb37d98a4ac283247272dc992b6ee22 | 2,203 | py | Python | todoapi/todoapi/settings.py | bogdan-cornianu/beginning-drf | b1c6efb85bf23b24f5afe90d819e57fa9ac2c1be | [
"MIT"
] | null | null | null | todoapi/todoapi/settings.py | bogdan-cornianu/beginning-drf | b1c6efb85bf23b24f5afe90d819e57fa9ac2c1be | [
"MIT"
] | null | null | null | todoapi/todoapi/settings.py | bogdan-cornianu/beginning-drf | b1c6efb85bf23b24f5afe90d819e57fa9ac2c1be | [
"MIT"
] | null | null | null | """
Django settings for a project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import o... | 23.945652 | 71 | 0.731276 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'pc3g2p43$7v+rf#x7%8tyt)fxsl&i=&hd2k-enz8+drzdcbd6f'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.co... | true | true |
1c34e1595e8822543910764580daaf03bcfeb67a | 60,852 | py | Python | pathlib_mate/pathlib2.py | MacHu-GWU/pathlib_mate-project | 5b8f5441e681730d02209211cce7f46986147418 | [
"MIT"
] | 9 | 2017-09-07T21:21:43.000Z | 2020-10-11T09:47:24.000Z | pathlib_mate/pathlib2.py | MacHu-GWU/pathlib_mate-project | 5b8f5441e681730d02209211cce7f46986147418 | [
"MIT"
] | 2 | 2018-10-16T14:30:26.000Z | 2020-12-05T02:40:46.000Z | pathlib_mate/pathlib2.py | MacHu-GWU/pathlib_mate-project | 5b8f5441e681730d02209211cce7f46986147418 | [
"MIT"
] | 2 | 2017-09-05T14:06:01.000Z | 2021-06-29T15:31:13.000Z | # Copyright (c) 2014-2017 Matthias C. M. Troffaes
# Copyright (c) 2012-2014 Antoine Pitrou and contributors
# Distributed under the terms of the MIT License.
# VERSION 2.5.3
# for python2 type hint
try:
import typing
except: # pragma: no cover
pass
import ctypes
import fnmatch
import functools
import io
impo... | 32.471718 | 79 | 0.559784 |
try:
import typing
except:
pass
import ctypes
import fnmatch
import functools
import io
import ntpath
import os
import posixpath
import re
import sys
from errno import EEXIST, EPERM, EACCES
from errno import EINVAL, ENOENT, ENOTDIR, EBADF
from operator import attrgetter
from stat import (
S_ISDIR, ... | true | true |
1c34e1be03260481dd35813ec70a53e1ca6f7892 | 14,217 | py | Python | src/fleetctrl/PoolingIRSOnly.py | TUM-VT/FleetPy | 596bcec9fbd2fe52206079641d549bf028d2879d | [
"MIT"
] | 19 | 2021-12-11T17:17:00.000Z | 2022-03-24T07:27:06.000Z | src/fleetctrl/PoolingIRSOnly.py | TUM-VT/FleetPy | 596bcec9fbd2fe52206079641d549bf028d2879d | [
"MIT"
] | null | null | null | src/fleetctrl/PoolingIRSOnly.py | TUM-VT/FleetPy | 596bcec9fbd2fe52206079641d549bf028d2879d | [
"MIT"
] | 1 | 2021-12-21T11:20:39.000Z | 2021-12-21T11:20:39.000Z | import logging
import time
from src.simulation.Offers import TravellerOffer
from src.fleetctrl.FleetControlBase import FleetControlBase
from src.fleetctrl.planning.PlanRequest import PlanRequest
from src.fleetctrl.pooling.objectives import return_pooling_objective_function
from src.fleetctrl.pooling.immediate.insertio... | 48.688356 | 120 | 0.676866 | import logging
import time
from src.simulation.Offers import TravellerOffer
from src.fleetctrl.FleetControlBase import FleetControlBase
from src.fleetctrl.planning.PlanRequest import PlanRequest
from src.fleetctrl.pooling.objectives import return_pooling_objective_function
from src.fleetctrl.pooling.immediate.insertio... | true | true |
1c34e2071a5e6fa4e09f6128585cb488e46b16c0 | 32,325 | py | Python | bert4keras/layers.py | EthanChen1234/bert4keras | 149b8abe4f5696f7762f49547533873b935f85b9 | [
"Apache-2.0"
] | null | null | null | bert4keras/layers.py | EthanChen1234/bert4keras | 149b8abe4f5696f7762f49547533873b935f85b9 | [
"Apache-2.0"
] | null | null | null | bert4keras/layers.py | EthanChen1234/bert4keras | 149b8abe4f5696f7762f49547533873b935f85b9 | [
"Apache-2.0"
] | null | null | null | #! -*- coding: utf-8 -*-
# 自定义层
import numpy as np
import tensorflow as tf
from bert4keras.backend import keras, K
from bert4keras.backend import sequence_masking
from bert4keras.backend import recompute_grad
from keras import initializers, activations
from keras.layers import *
def integerize_shape(func):
"""装饰... | 33.990536 | 80 | 0.578623 |
import numpy as np
import tensorflow as tf
from bert4keras.backend import keras, K
from bert4keras.backend import sequence_masking
from bert4keras.backend import recompute_grad
from keras import initializers, activations
from keras.layers import *
def integerize_shape(func):
def convert(item):
if hasat... | true | true |
1c34e66df50c012089ad360f1221b541925a79a1 | 2,194 | py | Python | aoc2018/d08-1.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | aoc2018/d08-1.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | aoc2018/d08-1.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | # coding: utf-8
import numpy as np
import re
import copy
import sys
import networkx as nx
#import matplotlib.pyplot as plt
#import operator
#from collections import defaultdict
from collections import Counter
import time
node_to_metadata = {}
def parse_node(idx, iii, tree, cur_node, DBG=True):
th... | 24.931818 | 130 | 0.618961 |
import numpy as np
import re
import copy
import sys
import networkx as nx
from collections import Counter
import time
node_to_metadata = {}
def parse_node(idx, iii, tree, cur_node, DBG=True):
this_node_name = cur_node
cur_node = chr(ord(cur_node) + 1)
tree.add_node(this_node_name)
... | true | true |
1c34e6a7c51538aa31a661dca1ae6805023e4aef | 2,525 | py | Python | problem_visual3.py | ligongzzz/MCM2020_Code | 7e5e6f9a6b09b3eb7e21774535c977ba6e974d79 | [
"MIT"
] | null | null | null | problem_visual3.py | ligongzzz/MCM2020_Code | 7e5e6f9a6b09b3eb7e21774535c977ba6e974d79 | [
"MIT"
] | null | null | null | problem_visual3.py | ligongzzz/MCM2020_Code | 7e5e6f9a6b09b3eb7e21774535c977ba6e974d79 | [
"MIT"
] | null | null | null | # Plays of the season.
import numpy as np
import cv2
import csv
import matplotlib.pyplot as plt
import matlab.engine
plt.rc('font', family='Times New Roman')
# Read the csv file.
csv_reader = csv.reader(open('./data/passingevents.csv'))
# The first match.(First match and self passing only.)
passing_list = [row for r... | 24.278846 | 79 | 0.610693 |
import numpy as np
import cv2
import csv
import matplotlib.pyplot as plt
import matlab.engine
plt.rc('font', family='Times New Roman')
csv_reader = csv.reader(open('./data/passingevents.csv'))
passing_list = [row for row in csv_reader if row[1] == 'Huskies']
for p in passing_list:
if p[4] == '2H':
p[... | true | true |
1c34e6fe8f5ecd00504b6dfac72ae815c3fd51fe | 10,991 | py | Python | pg_fts/migrations.py | dvdmgl/django-pg-fts | 38e2353dc1eec3ecbd10f6c8624c30ebd779cf8a | [
"BSD-2-Clause-FreeBSD"
] | 22 | 2015-01-06T08:17:28.000Z | 2021-10-03T11:41:22.000Z | pg_fts/migrations.py | dvdmgl/django-pg-fts | 38e2353dc1eec3ecbd10f6c8624c30ebd779cf8a | [
"BSD-2-Clause-FreeBSD"
] | 8 | 2015-01-06T09:21:56.000Z | 2019-01-19T17:57:16.000Z | pg_fts/migrations.py | dvdmgl/django-pg-fts | 38e2353dc1eec3ecbd10f6c8624c30ebd779cf8a | [
"BSD-2-Clause-FreeBSD"
] | 19 | 2015-01-24T10:09:35.000Z | 2019-05-15T18:15:55.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.migrations.operations.base import Operation
from pg_fts.fields import TSVectorField
__all__ = ('CreateFTSIndexOperation', 'CreateFTSTriggerOperation',
'DeleteFTSIndexOperation', 'DeleteFTSTriggerOperation',
'UpdateVec... | 32.137427 | 93 | 0.628332 |
from __future__ import unicode_literals
from django.db.migrations.operations.base import Operation
from pg_fts.fields import TSVectorField
__all__ = ('CreateFTSIndexOperation', 'CreateFTSTriggerOperation',
'DeleteFTSIndexOperation', 'DeleteFTSTriggerOperation',
'UpdateVectorOperation')
class... | true | true |
1c34e76a1364264b17273e5cfd2e40e011e851d5 | 3,041 | py | Python | python-flask/app.py | PujithaKurakula/BreastCancer-android-python-ml-app | ae1cd5b683a13e72169eda400322b3e17bb48bd9 | [
"Apache-2.0"
] | null | null | null | python-flask/app.py | PujithaKurakula/BreastCancer-android-python-ml-app | ae1cd5b683a13e72169eda400322b3e17bb48bd9 | [
"Apache-2.0"
] | null | null | null | python-flask/app.py | PujithaKurakula/BreastCancer-android-python-ml-app | ae1cd5b683a13e72169eda400322b3e17bb48bd9 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from flask import Flask, request, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/')
def home():
return render_template('h.html')
@app.route('/detect')
def detect():
return render_template('index.html')
... | 39.493506 | 515 | 0.750082 | import numpy as np
import pandas as pd
from flask import Flask, request, render_template
import pickle
app = Flask(__name__)
model = pickle.load(open('model.pkl', 'rb'))
@app.route('/')
def home():
return render_template('h.html')
@app.route('/detect')
def detect():
return render_template('index.html')
... | true | true |
1c34e95615ee7ca2019d86635649ccddde55a195 | 12,777 | py | Python | PPO.py | jacob-heglund/ece598-xmase | 7345b713fbb6d4f84c795cd52778312058cd80f8 | [
"Apache-2.0"
] | null | null | null | PPO.py | jacob-heglund/ece598-xmase | 7345b713fbb6d4f84c795cd52778312058cd80f8 | [
"Apache-2.0"
] | null | null | null | PPO.py | jacob-heglund/ece598-xmase | 7345b713fbb6d4f84c795cd52778312058cd80f8 | [
"Apache-2.0"
] | null | null | null | from numpy.core.fromnumeric import trace
import torch
import torch.nn as nn
from torch.distributions import MultivariateNormal
from torch.distributions import Categorical
import pdb
################################## set device ##################################
print("===============================================... | 39.680124 | 210 | 0.543633 | from numpy.core.fromnumeric import trace
import torch
import torch.nn as nn
from torch.distributions import MultivariateNormal
from torch.distributions import Categorical
import pdb
td_init
self.gamma = gamma
self.eps_clip = eps_clip
self.K_epochs = K_epochs
self.buffer = RolloutBuff... | true | true |
1c34eaa5ee0c570dfabd14d25e63956b1f1316de | 327 | py | Python | Codility_10.py | Bartoshko/codility-python-training | 5ac53e85948692c8e6c44090e68b93136b263f9c | [
"MIT"
] | null | null | null | Codility_10.py | Bartoshko/codility-python-training | 5ac53e85948692c8e6c44090e68b93136b263f9c | [
"MIT"
] | null | null | null | Codility_10.py | Bartoshko/codility-python-training | 5ac53e85948692c8e6c44090e68b93136b263f9c | [
"MIT"
] | null | null | null | # works 100%
arr_0 = [0,1,0,1,1]
arr_1 = [0,1,0,1,0,1,0,1,0,1]
def solution(A):
increment = 0
counter = 0
value = 0
for i in A:
if i == 0:
increment += 1
if i == 1:
value += increment
counter += increment
if counter > 1000000000:
return -1
return counter
print(solution(arr_0))
print(solution(... | 14.863636 | 29 | 0.608563 |
arr_0 = [0,1,0,1,1]
arr_1 = [0,1,0,1,0,1,0,1,0,1]
def solution(A):
increment = 0
counter = 0
value = 0
for i in A:
if i == 0:
increment += 1
if i == 1:
value += increment
counter += increment
if counter > 1000000000:
return -1
return counter
print(solution(arr_0))
print(solution(arr_1)) | true | true |
1c34eb0121879b126de166589387ff58843cec09 | 9,734 | py | Python | adlibre_tms/apps/saasu_client/models/items.py | adlibre/Adlibre-TMS | 4c8de1e4448203fb267d38ec0f4ec9e64d58a21d | [
"BSD-3-Clause"
] | 26 | 2015-01-06T11:09:18.000Z | 2022-03-16T06:20:53.000Z | adlibre_tms/apps/saasu_client/models/items.py | adlibre/Adlibre-TMS | 4c8de1e4448203fb267d38ec0f4ec9e64d58a21d | [
"BSD-3-Clause"
] | 4 | 2015-02-26T11:00:35.000Z | 2020-06-05T18:02:02.000Z | adlibre_tms/apps/saasu_client/models/items.py | adlibre/Adlibre-TMS | 4c8de1e4448203fb267d38ec0f4ec9e64d58a21d | [
"BSD-3-Clause"
] | 16 | 2015-02-08T05:24:38.000Z | 2021-06-13T14:45:30.000Z | # -*- coding: utf-8 -*-
import xml_models
from saasu_client import DEFAULT_GET_URL
from saasu_client.models.base import BaseModel, CollectionField
__all__ = ['InventoryItem', 'FullInventoryItemList']
class InventoryItem(BaseModel):
""" Inventory Item Entity """
__model__ = 'InventoryItem'
# Required ... | 62.8 | 134 | 0.771625 |
import xml_models
from saasu_client import DEFAULT_GET_URL
from saasu_client.models.base import BaseModel, CollectionField
__all__ = ['InventoryItem', 'FullInventoryItemList']
class InventoryItem(BaseModel):
__model__ = 'InventoryItem'
uid = xml_models.IntField(xpath="/inventoryItemResponse/invento... | true | true |
1c34eb4801c8e897558782c5062336dabefbfe82 | 1,240 | py | Python | pipeline/processing/data.py | UNDP-Data/sids-data-pipeline | 16953bfe25bc4425f699937a83f5ed0c8755197a | [
"MIT"
] | null | null | null | pipeline/processing/data.py | UNDP-Data/sids-data-pipeline | 16953bfe25bc4425f699937a83f5ed0c8755197a | [
"MIT"
] | null | null | null | pipeline/processing/data.py | UNDP-Data/sids-data-pipeline | 16953bfe25bc4425f699937a83f5ed0c8755197a | [
"MIT"
] | null | null | null | from .config import download_path
from .utils import cwd, logging, read_csv, download_file
logger = logging.getLogger(__name__)
def get_rows(data_type, input_ext, tmp_ext):
rows = read_csv(cwd / f'../inputs/{data_type}.csv')
for row in rows:
blob_path = download_path / f"{data_type}/{row['id']}.{inpu... | 34.444444 | 75 | 0.662097 | from .config import download_path
from .utils import cwd, logging, read_csv, download_file
logger = logging.getLogger(__name__)
def get_rows(data_type, input_ext, tmp_ext):
rows = read_csv(cwd / f'../inputs/{data_type}.csv')
for row in rows:
blob_path = download_path / f"{data_type}/{row['id']}.{inpu... | true | true |
1c34eb7196851f652877086b511994be5ae8037e | 9,307 | py | Python | tests/test_data/test_datasets/test_s3dis_dataset.py | jhkim-spa/CVNet | 126a3155f414bf47e9e4f6fec121420fd378ea21 | [
"Apache-2.0"
] | 1 | 2021-10-20T05:21:21.000Z | 2021-10-20T05:21:21.000Z | tests/test_data/test_datasets/test_s3dis_dataset.py | jhkim-spa/CVNet | 126a3155f414bf47e9e4f6fec121420fd378ea21 | [
"Apache-2.0"
] | null | null | null | tests/test_data/test_datasets/test_s3dis_dataset.py | jhkim-spa/CVNet | 126a3155f414bf47e9e4f6fec121420fd378ea21 | [
"Apache-2.0"
] | 1 | 2022-02-16T07:25:55.000Z | 2022-02-16T07:25:55.000Z | import numpy as np
import pytest
import torch
from mmdet3d.datasets import S3DISSegDataset
def test_seg_getitem():
np.random.seed(0)
root_path = './tests/data/s3dis/'
ann_file = './tests/data/s3dis/s3dis_infos.pkl'
class_names = ('ceiling', 'floor', 'wall', 'beam', 'column', 'window',
... | 37.987755 | 79 | 0.578812 | import numpy as np
import pytest
import torch
from mmdet3d.datasets import S3DISSegDataset
def test_seg_getitem():
np.random.seed(0)
root_path = './tests/data/s3dis/'
ann_file = './tests/data/s3dis/s3dis_infos.pkl'
class_names = ('ceiling', 'floor', 'wall', 'beam', 'column', 'window',
... | true | true |
1c34ebab0150fa1f9681a77d86d7978fddaa546e | 23,218 | py | Python | test/functional/test_framework/mininode.py | deeponion/deeponion2 | 2dc92ed83f5639b528e0c1279bdd214bb92ef286 | [
"MIT"
] | 569 | 2017-07-26T23:14:31.000Z | 2022-01-13T20:29:04.000Z | test/functional/test_framework/mininode.py | cpyberry/deeponion | 448b4a1ea7c90294d9ace03ea5a9648fb9b1107e | [
"MIT"
] | 155 | 2017-07-17T15:40:36.000Z | 2021-12-07T07:59:33.000Z | test/functional/test_framework/mininode.py | cpyberry/deeponion | 448b4a1ea7c90294d9ace03ea5a9648fb9b1107e | [
"MIT"
] | 214 | 2017-07-17T15:36:08.000Z | 2021-11-04T23:38:37.000Z | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""DeepOnion P2... | 39.352542 | 182 | 0.644974 |
import asyncio
from collections import defaultdict
from io import BytesIO
import logging
import struct
import sys
import threading
from test_framework.messages import (
CBlockHeader,
MIN_VERSION_SUPPORTED,
msg_addr,
msg_block,
MSG_BLOCK,
msg_blocktxn,
msg_cmpctblock,
msg_feefilter... | true | true |
1c34ec5b0922266c3e466c89dc031fd7d675e72f | 412 | py | Python | migrations/versions/0302a_merge.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0302a_merge.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0302a_merge.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """
Revision ID: 0302a_merge
Revises: 0301c_update_golive_template, 0302_add_org_id_to_services
Create Date: 2019-07-29 16:18:27.467361
"""
# revision identifiers, used by Alembic.
revision = "0302a_merge"
down_revision = ("0301c_update_golive_template", "0302_add_org_id_to_services")
branch_labels = None
import sq... | 17.166667 | 79 | 0.771845 |
revision = "0302a_merge"
down_revision = ("0301c_update_golive_template", "0302_add_org_id_to_services")
branch_labels = None
import sqlalchemy as sa
from alembic import op
def upgrade():
pass
def downgrade():
pass
| true | true |
1c34ec9156ccc0bddc9813d98d2ba5a9fbc1cc96 | 423 | py | Python | user-management-api/user_management_project/asgi.py | washimimizuku/django-tutorials | 4f0e3836778dd3ea5403ef713e2f6777e44eae8d | [
"MIT"
] | null | null | null | user-management-api/user_management_project/asgi.py | washimimizuku/django-tutorials | 4f0e3836778dd3ea5403ef713e2f6777e44eae8d | [
"MIT"
] | null | null | null | user-management-api/user_management_project/asgi.py | washimimizuku/django-tutorials | 4f0e3836778dd3ea5403ef713e2f6777e44eae8d | [
"MIT"
] | null | null | null | """
ASGI config for user_management_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefau... | 24.882353 | 83 | 0.801418 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'user_management_project.settings')
application = get_asgi_application()
| true | true |
1c34ed8262045aa8f685164bd58552086bd69fb1 | 348 | py | Python | virtualscreening/vina/spark/pdb_io.py | rodrigofaccioli/drugdesign | de15880af361a010729b1f4fbc8a75a2b36688a6 | [
"Apache-2.0"
] | 3 | 2015-01-19T20:12:59.000Z | 2019-02-21T18:43:04.000Z | virtualscreening/vina/spark/pdb_io.py | rodrigofaccioli/drugdesign | de15880af361a010729b1f4fbc8a75a2b36688a6 | [
"Apache-2.0"
] | 22 | 2015-01-05T16:48:54.000Z | 2017-01-21T16:36:10.000Z | virtualscreening/vina/spark/pdb_io.py | rodrigofaccioli/drugdesign | de15880af361a010729b1f4fbc8a75a2b36688a6 | [
"Apache-2.0"
] | 11 | 2015-03-03T13:32:24.000Z | 2020-04-03T11:22:24.000Z | def adding_chain_atom_line(atom_line,chain="Z"):
returned_line = ""
for i in range(0,len(atom_line)):
#it means column 22
if i == 21:
returned_line += chain
returned_line += atom_line[i]
return returned_line
def replace_chain_atom_line(atom_line,chain_ref="d",new_chain="Z"):
return str(atom_line).re... | 26.769231 | 67 | 0.732759 | def adding_chain_atom_line(atom_line,chain="Z"):
returned_line = ""
for i in range(0,len(atom_line)):
if i == 21:
returned_line += chain
returned_line += atom_line[i]
return returned_line
def replace_chain_atom_line(atom_line,chain_ref="d",new_chain="Z"):
return str(atom_line).replace(chain_ref,new... | true | true |
1c34ef0c08d81ab26cc421a11e492e66257f386a | 265 | py | Python | openapi_core/validation/datatypes.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 160 | 2017-11-20T13:39:04.000Z | 2022-03-31T14:48:27.000Z | openapi_core/validation/datatypes.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 384 | 2017-09-21T12:42:31.000Z | 2022-03-21T17:21:05.000Z | openapi_core/validation/datatypes.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 100 | 2017-11-21T08:07:01.000Z | 2022-01-20T20:32:52.000Z | """OpenAPI core validation datatypes module"""
from dataclasses import dataclass
from typing import List
@dataclass
class BaseValidationResult:
errors: List[Exception]
def raise_for_errors(self):
for error in self.errors:
raise error
| 20.384615 | 46 | 0.724528 | from dataclasses import dataclass
from typing import List
@dataclass
class BaseValidationResult:
errors: List[Exception]
def raise_for_errors(self):
for error in self.errors:
raise error
| true | true |
1c34ef485e743b17c67738c34003630dbdd389ce | 13,757 | py | Python | modules/py/pkgs/QNLP/proc/DisCoCat.py | ICHEC/QNLP | 2966c7f71e6979c7ddef62520c3749cf6473fabe | [
"Apache-2.0"
] | 29 | 2020-04-13T04:40:35.000Z | 2021-12-17T11:21:35.000Z | modules/py/pkgs/QNLP/proc/DisCoCat.py | ICHEC/QNLP | 2966c7f71e6979c7ddef62520c3749cf6473fabe | [
"Apache-2.0"
] | 6 | 2020-03-12T17:40:00.000Z | 2021-01-20T12:15:08.000Z | modules/py/pkgs/QNLP/proc/DisCoCat.py | ICHEC/QNLP | 2966c7f71e6979c7ddef62520c3749cf6473fabe | [
"Apache-2.0"
] | 9 | 2020-09-28T05:00:30.000Z | 2022-03-04T02:11:49.000Z | ###############################################################################
import sqlite3
import os
from typing import Dict, Tuple
import QNLP.proc.process_corpus as pc
import numpy as np
from QNLP.io.qnlp_db import qnlp_db as qnlp_db
##############################################################################... | 46.010033 | 458 | 0.535873 | true | true | |
1c34efaf717edb20399b7bb104621e96df0873ca | 2,239 | py | Python | scrapers/seamus/scraper.py | nprapps/graeae | b38cdd3de74fb239fdcc92619e92bcfb0818bda3 | [
"MIT"
] | 5 | 2015-06-10T15:37:46.000Z | 2015-10-12T15:28:37.000Z | scrapers/seamus/scraper.py | nprapps/graeae | b38cdd3de74fb239fdcc92619e92bcfb0818bda3 | [
"MIT"
] | 175 | 2015-04-14T20:14:57.000Z | 2015-07-13T13:50:45.000Z | scrapers/seamus/scraper.py | nprapps/graeae | b38cdd3de74fb239fdcc92619e92bcfb0818bda3 | [
"MIT"
] | 3 | 2015-08-27T14:34:09.000Z | 2021-02-23T11:03:40.000Z | #!/usr/bin/env python
from datetime import datetime
import logging
import os
import requests
from pyquery import PyQuery
from app_config import get_secrets
from models import Story
SECRETS = get_secrets()
SEAMUS_API_PAGE_SIZE = 20
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.I... | 25.735632 | 90 | 0.571684 |
from datetime import datetime
import logging
import os
import requests
from pyquery import PyQuery
from app_config import get_secrets
from models import Story
SECRETS = get_secrets()
SEAMUS_API_PAGE_SIZE = 20
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class SeamusScr... | true | true |
1c34f00f6f6deff2422988c51a4cdf2397490bc5 | 1,021 | py | Python | lab6/Q6_1_1.py | kommunium/dip-lab | 2c8e08a994fb34b87da55da48a7b72b7c13d9c81 | [
"MIT"
] | null | null | null | lab6/Q6_1_1.py | kommunium/dip-lab | 2c8e08a994fb34b87da55da48a7b72b7c13d9c81 | [
"MIT"
] | null | null | null | lab6/Q6_1_1.py | kommunium/dip-lab | 2c8e08a994fb34b87da55da48a7b72b7c13d9c81 | [
"MIT"
] | null | null | null | import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
# %% Q6_1_1 max filter
Q6_1_1 = np.asarray(Image.open("Q6_1_1.tiff"))
def max_filter(img_raw, n: int):
m = (n - 1) // 2
row, col = img_raw.shape
img_pad = np.pad(img_raw, m)
img_out = np.array([img_pad[i:i + n, j:j + n].max... | 26.868421 | 55 | 0.665034 | import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
Q6_1_1 = np.asarray(Image.open("Q6_1_1.tiff"))
def max_filter(img_raw, n: int):
m = (n - 1) // 2
row, col = img_raw.shape
img_pad = np.pad(img_raw, m)
img_out = np.array([img_pad[i:i + n, j:j + n].max()
... | true | true |
1c34f054cc39f409c990152fefa119a2bf2c71cb | 995 | py | Python | learning/katas/python/Common Transforms/Aggregation/Count/task.py | charithe/beam | f085cb500730cf0c67c467ac55f92b3c59f52b39 | [
"Apache-2.0"
] | 35 | 2016-09-22T22:53:14.000Z | 2020-02-13T15:12:21.000Z | learning/katas/python/Common Transforms/Aggregation/Count/task.py | charithe/beam | f085cb500730cf0c67c467ac55f92b3c59f52b39 | [
"Apache-2.0"
] | 71 | 2018-05-23T22:20:02.000Z | 2019-04-30T15:37:46.000Z | learning/katas/python/Common Transforms/Aggregation/Count/task.py | charithe/beam | f085cb500730cf0c67c467ac55f92b3c59f52b39 | [
"Apache-2.0"
] | 88 | 2016-11-27T02:16:11.000Z | 2020-02-28T05:10:26.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); y... | 35.535714 | 76 | 0.739698 |
import apache_beam as beam
from log_elements import LogElements
p = beam.Pipeline()
(p | beam.Create(range(1, 11))
| beam.combiners.Count.Globally()
| LogElements())
p.run()
| true | true |
1c34f08aae1ab12bac8cb59e8a8cd37e3fd4e4aa | 199 | py | Python | src/ArtificialConduction/ArtificialConductionPolicyInst.cc.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 22 | 2018-07-31T21:38:22.000Z | 2020-06-29T08:58:33.000Z | src/ArtificialConduction/ArtificialConductionPolicyInst.cc.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 41 | 2020-09-28T23:14:27.000Z | 2022-03-28T17:01:33.000Z | src/ArtificialConduction/ArtificialConductionPolicyInst.cc.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 7 | 2019-12-01T07:00:06.000Z | 2020-09-15T21:12:39.000Z | text = """
#include "ArtificialConduction/ArtificialConductionPolicy.cc"
#include "Geometry/Dimension.hh"
namespace Spheral {
template class ArtificialConductionPolicy< Dim< %(ndim)s > >;
}
"""
| 22.111111 | 65 | 0.743719 | text = """
#include "ArtificialConduction/ArtificialConductionPolicy.cc"
#include "Geometry/Dimension.hh"
namespace Spheral {
template class ArtificialConductionPolicy< Dim< %(ndim)s > >;
}
"""
| true | true |
1c34f0e97ac6368ed1711029606b4e87c6a3c764 | 18 | py | Python | opsdroid/testing/mockmodules/skills/skill/skilltest/mock.py | JiahnChoi/opsdroid.kr | 0893456b0f9f6c70edf7c330a7593d87450538cc | [
"Apache-2.0"
] | 712 | 2016-08-09T21:30:07.000Z | 2022-03-24T09:38:21.000Z | opsdroid/testing/mockmodules/skills/skill/skilltest/mock.py | JiahnChoi/opsdroid.kr | 0893456b0f9f6c70edf7c330a7593d87450538cc | [
"Apache-2.0"
] | 1,767 | 2016-07-27T13:01:25.000Z | 2022-03-29T04:25:10.000Z | opsdroid/testing/mockmodules/skills/skill/skilltest/mock.py | JiahnChoi/opsdroid.kr | 0893456b0f9f6c70edf7c330a7593d87450538cc | [
"Apache-2.0"
] | 536 | 2016-07-31T14:23:41.000Z | 2022-03-22T17:35:15.000Z | """Mock skill."""
| 9 | 17 | 0.5 | true | true | |
1c34f167c66b512c11d05e984e2da8670df79f29 | 1,960 | py | Python | pyclesperanto_prototype/_tier3/_mode_of_proximal_neighbors_map.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 64 | 2020-03-18T12:11:22.000Z | 2022-03-31T08:19:18.000Z | pyclesperanto_prototype/_tier3/_mode_of_proximal_neighbors_map.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 148 | 2020-05-14T06:14:11.000Z | 2022-03-26T15:02:31.000Z | pyclesperanto_prototype/_tier3/_mode_of_proximal_neighbors_map.py | elsandal/pyclesperanto_prototype | 7bda828813b86b44b63d73d5e8f466d9769cded1 | [
"BSD-3-Clause"
] | 16 | 2020-05-31T00:53:44.000Z | 2022-03-23T13:20:57.000Z | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
import numpy as np
@plugin_function(categories=['combine', 'neighbor', 'map', 'in assistant'])
def mode_of_proximal_neighbors_map(parametric_map : Image, label_map : Image, parametric_map_destination : Image = None, min_distan... | 39.2 | 196 | 0.760204 | from .._tier0 import execute
from .._tier0 import plugin_function
from .._tier0 import Image
import numpy as np
@plugin_function(categories=['combine', 'neighbor', 'map', 'in assistant'])
def mode_of_proximal_neighbors_map(parametric_map : Image, label_map : Image, parametric_map_destination : Image = None, min_distan... | true | true |
1c34f23b14017b4111a937164abe1270b2fd4ee1 | 1,822 | py | Python | py/DirectShape.Transform.py | mathematicalmichael/SpringNodes | 3ff4034b6e57ee6efa55c963e1819f3d30a2c4ab | [
"MIT"
] | 51 | 2015-09-25T09:30:57.000Z | 2022-01-19T14:16:44.000Z | py/DirectShape.Transform.py | sabeelcoder/SpringNodes | e21a24965474d54369e74d23c06f8c42a7b926b5 | [
"MIT"
] | 66 | 2015-09-30T02:43:32.000Z | 2022-03-31T02:26:52.000Z | py/DirectShape.Transform.py | sabeelcoder/SpringNodes | e21a24965474d54369e74d23c06f8c42a7b926b5 | [
"MIT"
] | 48 | 2015-11-19T01:34:47.000Z | 2022-02-25T17:26:48.000Z | #Copyright(c) 2016, Dimitar Venkov
# @5devene, dimitar.ven@gmail.com
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.... | 30.881356 | 108 | 0.791438 |
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application
isRvt2017 = int(app.Versi... | true | true |
1c34f34beeb4ca12cb5aba811339a1c44f064b3e | 1,938 | py | Python | Utilities/BootstrapMean/BootstrapMean.py | wavefancy/BIDMC-PYTHON | 97c7d3e1bec19dd7fea34d4ecebbdf2af2b1faed | [
"MIT"
] | null | null | null | Utilities/BootstrapMean/BootstrapMean.py | wavefancy/BIDMC-PYTHON | 97c7d3e1bec19dd7fea34d4ecebbdf2af2b1faed | [
"MIT"
] | null | null | null | Utilities/BootstrapMean/BootstrapMean.py | wavefancy/BIDMC-PYTHON | 97c7d3e1bec19dd7fea34d4ecebbdf2af2b1faed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Bootstrap values to estimate confidence interval for mean.
@Author: wavefancy@gmail.com
Usage:
BootstrapMean.py -n times -c confidence
BootstrapMean.py -h | --help | -v | --version | -f | --format
Notes:
1. Read content from stdin, and output resul... | 28.5 | 117 | 0.592879 |
import sys
from docopt import docopt
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE,SIG_DFL)
if __name__ == '__main__':
args = docopt(__doc__, version='1.0')
ntimes = 100
confidence = []
if args['-n']:
ntimes = int(args['-n'])
if args['-c']:
confidence = [float(... | true | true |
1c34f35af8b61be42feaa3545d57c4cef1af40d0 | 454 | py | Python | plugins/ledger/cmdline.py | nxsofsys/electrum-zcl | 3675fa2f871a4e944fc875a4653f95d9b38b9e29 | [
"MIT"
] | 1 | 2021-04-04T20:40:29.000Z | 2021-04-04T20:40:29.000Z | plugins/ledger/cmdline.py | nxsofsys/electrum-zcl | 3675fa2f871a4e944fc875a4653f95d9b38b9e29 | [
"MIT"
] | null | null | null | plugins/ledger/cmdline.py | nxsofsys/electrum-zcl | 3675fa2f871a4e944fc875a4653f95d9b38b9e29 | [
"MIT"
] | null | null | null | from legder import LedgerPlugin
from electrum_vtc.util import print_msg
class BTChipCmdLineHandler:
def stop(self):
pass
def show_message(self, msg):
print_msg(msg)
def prompt_auth(self, msg):
import getpass
print_msg(msg)
response = getpass.getpass('')
if ... | 21.619048 | 39 | 0.645374 | from legder import LedgerPlugin
from electrum_vtc.util import print_msg
class BTChipCmdLineHandler:
def stop(self):
pass
def show_message(self, msg):
print_msg(msg)
def prompt_auth(self, msg):
import getpass
print_msg(msg)
response = getpass.getpass('')
if ... | true | true |
1c34f3b0be47bed7d917fc9a5adf536d78f30809 | 634 | py | Python | app/models/domain/rwmodel.py | StanislavRud/api-realword-app-test | 9a49f299b02cec26d237f3bc4b363c8b93520b7b | [
"MIT"
] | 1,875 | 2019-03-27T14:26:20.000Z | 2022-03-31T14:52:50.000Z | app/models/domain/rwmodel.py | StanislavRud/api-realword-app-test | 9a49f299b02cec26d237f3bc4b363c8b93520b7b | [
"MIT"
] | 232 | 2019-04-11T11:05:48.000Z | 2022-03-05T10:23:50.000Z | app/models/domain/rwmodel.py | StanislavRud/api-realword-app-test | 9a49f299b02cec26d237f3bc4b363c8b93520b7b | [
"MIT"
] | 433 | 2019-04-11T01:48:59.000Z | 2022-03-31T10:33:42.000Z | import datetime
from pydantic import BaseConfig, BaseModel
def convert_datetime_to_realworld(dt: datetime.datetime) -> str:
return dt.replace(tzinfo=datetime.timezone.utc).isoformat().replace("+00:00", "Z")
def convert_field_to_camel_case(string: str) -> str:
return "".join(
word if index == 0 else... | 28.818182 | 86 | 0.722397 | import datetime
from pydantic import BaseConfig, BaseModel
def convert_datetime_to_realworld(dt: datetime.datetime) -> str:
return dt.replace(tzinfo=datetime.timezone.utc).isoformat().replace("+00:00", "Z")
def convert_field_to_camel_case(string: str) -> str:
return "".join(
word if index == 0 else... | true | true |
1c34f3f80eecf4e930c3ce750c5a552fb38cecad | 3,809 | py | Python | src/transformers/tokenization_distilbert.py | dmlap/transformers | 79588e6fdb5af8add092fc27dd695ea1ebc68b18 | [
"Apache-2.0"
] | 647 | 2020-10-27T01:35:35.000Z | 2022-03-29T12:59:11.000Z | src/transformers/tokenization_distilbert.py | hmason/transformers | ab90353f1abfd15f8d21f99395658d060679a08c | [
"Apache-2.0"
] | 30 | 2020-06-07T12:28:07.000Z | 2022-03-20T05:26:03.000Z | src/transformers/tokenization_distilbert.py | hmason/transformers | ab90353f1abfd15f8d21f99395658d060679a08c | [
"Apache-2.0"
] | 48 | 2020-07-15T09:45:46.000Z | 2022-03-01T07:27:59.000Z | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 41.402174 | 139 | 0.757942 |
import logging
from .tokenization_bert import BertTokenizer, BertTokenizerFast
logger = logging.getLogger(__name__)
VOCAB_FILES_NAMES = {"vocab_file": "vocab.txt"}
PRETRAINED_VOCAB_FILES_MAP = {
"vocab_file": {
"distilbert-base-uncased": "https://s3.amazonaws.com/models.huggingface.co/b... | true | true |
1c34f46b2bd79018cc6279a1ed2396587cb5a3b9 | 24,065 | py | Python | quantstats/_plotting/core.py | danilodsp/quantstats | 67a647baeba756c57d87bc7028f55d4dee8702b4 | [
"Apache-2.0"
] | 1 | 2019-09-03T11:06:16.000Z | 2019-09-03T11:06:16.000Z | quantstats/_plotting/core.py | danilodsp/quantstats | 67a647baeba756c57d87bc7028f55d4dee8702b4 | [
"Apache-2.0"
] | null | null | null | quantstats/_plotting/core.py | danilodsp/quantstats | 67a647baeba756c57d87bc7028f55d4dee8702b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Quantreturns: Portfolio analytics for quants
# https://github.com/ranaroussi/quantreturns
#
# Copyright 2019 Ran Aroussi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... | 30.308564 | 78 | 0.564471 |
import matplotlib.pyplot as _plt
try:
_plt.rcParams["font.family"] = "Arial"
except Exception:
pass
import matplotlib.dates as _mdates
from matplotlib.ticker import (
FormatStrFormatter as _FormatStrFormatter,
FuncFormatter as _FuncFormatter
)
import pandas as _pd
import numpy as _... | true | true |
1c34f495a5af2eb1cfba1648b37b88a451fb5063 | 2,597 | py | Python | tests/__init__.py | Kinto/kinto-pusher | 9cad48b33a55d64f69cabf7d4c7eab15145e4a74 | [
"Apache-2.0"
] | 8 | 2016-06-07T09:49:52.000Z | 2018-08-01T11:06:45.000Z | tests/__init__.py | Kinto/kinto-pusher | 9cad48b33a55d64f69cabf7d4c7eab15145e4a74 | [
"Apache-2.0"
] | 12 | 2016-05-20T16:41:10.000Z | 2020-03-31T18:20:02.000Z | tests/__init__.py | Kinto/kinto-pusher | 9cad48b33a55d64f69cabf7d4c7eab15145e4a74 | [
"Apache-2.0"
] | 5 | 2016-05-26T12:54:44.000Z | 2019-04-17T22:31:31.000Z | import kinto.core
import webtest
from kinto.core.utils import random_bytes_hex
from pyramid.config import Configurator
def get_request_class(prefix):
class PrefixedRequestClass(webtest.app.TestRequest):
@classmethod
def blank(cls, path, *args, **kwargs):
path = "/%s%s" % (prefix, path... | 35.575342 | 73 | 0.663843 | import kinto.core
import webtest
from kinto.core.utils import random_bytes_hex
from pyramid.config import Configurator
def get_request_class(prefix):
class PrefixedRequestClass(webtest.app.TestRequest):
@classmethod
def blank(cls, path, *args, **kwargs):
path = "/%s%s" % (prefix, path... | true | true |
1c34f4fd314bfea96ecf0e4939d2eff0afa450f9 | 471 | py | Python | roundup.py | lpig/some_tools | 4c7e9ee95bef2c230a2a6bd2fdca7dc19ea3e1dc | [
"MIT"
] | 2 | 2020-03-23T11:02:37.000Z | 2020-04-17T08:02:35.000Z | roundup.py | lpig/some_tools | 4c7e9ee95bef2c230a2a6bd2fdca7dc19ea3e1dc | [
"MIT"
] | null | null | null | roundup.py | lpig/some_tools | 4c7e9ee95bef2c230a2a6bd2fdca7dc19ea3e1dc | [
"MIT"
] | null | null | null | import math
def roundup_int(x: int, num_digits: int) -> int:
"""
round up like excel roundup
向上取证方法,暂时只支持整数
**One**::
>>> num = roundup_int(123,-1)
>>> num
130
"""
if num_digits > 0:
raise TypeError(f'is over 0! digit:{num_digits}')
num_digits = abs(num_di... | 21.409091 | 75 | 0.577495 | import math
def roundup_int(x: int, num_digits: int) -> int:
if num_digits > 0:
raise TypeError(f'is over 0! digit:{num_digits}')
num_digits = abs(num_digits)
_num_digits = 1 * math.pow(10, num_digits)
_num = x if x % _num_digits == 0 else x + _num_digits - x % _num_digits
return int(_num... | true | true |
1c34f52b43551b4ecb53a18ee47a50477a3bac98 | 933 | py | Python | main.py | NicksonYap/T-1000 | e1f82f9e72cb5407bb01a83daa278c51b2e30c2a | [
"MIT"
] | null | null | null | main.py | NicksonYap/T-1000 | e1f82f9e72cb5407bb01a83daa278c51b2e30c2a | [
"MIT"
] | null | null | null | main.py | NicksonYap/T-1000 | e1f82f9e72cb5407bb01a83daa278c51b2e30c2a | [
"MIT"
] | null | null | null | if __name__ == '__main__':
from utils import loading
loading()
from core_main import Nostradamus
env = Nostradamus(assets=['XRP','BCH','LTC','BNB'],
currency='BTC',
granularity='day',
datapoints=600)
env.train(timesteps=1e6,
... | 31.1 | 104 | 0.392283 | if __name__ == '__main__':
from utils import loading
loading()
from core_main import Nostradamus
env = Nostradamus(assets=['XRP','BCH','LTC','BNB'],
currency='BTC',
granularity='day',
datapoints=600)
env.train(timesteps=1e6,
... | true | true |
1c34f53fb3ea558447b8a363a8aeb941c702c8c5 | 557 | py | Python | src/ap_games/ap_typing.py | aplatkouski/tic-tac-toe | d5dc8f5c1f75226989326163a18505e6d88a8f49 | [
"MIT"
] | null | null | null | src/ap_games/ap_typing.py | aplatkouski/tic-tac-toe | d5dc8f5c1f75226989326163a18505e6d88a8f49 | [
"MIT"
] | null | null | null | src/ap_games/ap_typing.py | aplatkouski/tic-tac-toe | d5dc8f5c1f75226989326163a18505e6d88a8f49 | [
"MIT"
] | 1 | 2020-08-25T12:51:53.000Z | 2020-08-25T12:51:53.000Z | from __future__ import annotations
from typing import Dict
from typing import Literal
from typing import Tuple
from ap_games.ap_collections import Cell
from ap_games.ap_collections import Coordinate
from ap_games.ap_collections import Node
Mark = Literal['X', 'O', ' ', '']
Empty = Literal[' ']
PlayerMark = Literal['... | 25.318182 | 67 | 0.723519 | from __future__ import annotations
from typing import Dict
from typing import Literal
from typing import Tuple
from ap_games.ap_collections import Cell
from ap_games.ap_collections import Coordinate
from ap_games.ap_collections import Node
Mark = Literal['X', 'O', ' ', '']
Empty = Literal[' ']
PlayerMark = Literal['... | true | true |
1c34f59d7b3d2551889648884bb963a9eb45ca7f | 3,726 | py | Python | examples/08_tfRecord.py | csehong/stanford-tensorflow-tutorials | fd93ff0568914724f2b9e97920eb8d6138efc52c | [
"MIT"
] | 1 | 2020-11-24T09:35:19.000Z | 2020-11-24T09:35:19.000Z | examples/08_tfRecord.py | csehong/stanford-tensorflow-tutorials | fd93ff0568914724f2b9e97920eb8d6138efc52c | [
"MIT"
] | null | null | null | examples/08_tfRecord.py | csehong/stanford-tensorflow-tutorials | fd93ff0568914724f2b9e97920eb8d6138efc52c | [
"MIT"
] | null | null | null | """ Examples to demonstrate how to write an image file to a TFRecord,
and how to read a TFRecord file using TFRecordReader.
Author: Chip Huyen
Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research"
cs20si.stanford.edu
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import sys
sys.path.append('..'... | 36.174757 | 91 | 0.685185 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import sys
sys.path.append('..')
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
IMAGE_PATH = 'data/'
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
def _bytes_feat... | true | true |
1c34f636c13ffeacfc990b9129d8526b74bf2b7b | 4,681 | py | Python | tothc/managers.py | kennydo/tweets-of-the-highest-caliber | 5f9d61ded2b4d9e0e65af0524321eac448c79a68 | [
"MIT"
] | null | null | null | tothc/managers.py | kennydo/tweets-of-the-highest-caliber | 5f9d61ded2b4d9e0e65af0524321eac448c79a68 | [
"MIT"
] | null | null | null | tothc/managers.py | kennydo/tweets-of-the-highest-caliber | 5f9d61ded2b4d9e0e65af0524321eac448c79a68 | [
"MIT"
] | null | null | null | import datetime
import logging
from typing import List
from databases.core import Connection
from tothc import models
log = logging.getLogger(__name__)
class TwitterSubscriptionManager:
@classmethod
async def subscribe(
cls,
connection: Connection,
*,
user_id: int,
... | 32.506944 | 107 | 0.553514 | import datetime
import logging
from typing import List
from databases.core import Connection
from tothc import models
log = logging.getLogger(__name__)
class TwitterSubscriptionManager:
@classmethod
async def subscribe(
cls,
connection: Connection,
*,
user_id: int,
... | true | true |
1c34f6884d500d11e54c5e32765f323a948b2fef | 1,180 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/DataExchangeMessageSeverity.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/DataExchangeMessageSeverity.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/DataExchangeMessageSeverity.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class DataExchangeMessageSeverity(Enum, IComparable, IFormattable, IConvertible):
"""
Error levels for DataExchangeLog
enum DataExchangeMessageSeverity,values: Error (2),FatalError (3),Info (0),Warning (1)
"""
def __eq__(self, *args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__e... | 24.583333 | 221 | 0.574576 | class DataExchangeMessageSeverity(Enum, IComparable, IFormattable, IConvertible):
def __eq__(self, *args):
pass
def __format__(self, *args):
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __init__(self, *args):
pass
... | true | true |
1c34f713dedfef8b5b8a0e3a156db7d83a3fba3b | 36,760 | py | Python | lib/tests/test_bitcoin.py | D3m0nKingx/electrum-ganja | be204713107626f3e334e9fd5974c044a9f2ffb6 | [
"MIT"
] | null | null | null | lib/tests/test_bitcoin.py | D3m0nKingx/electrum-ganja | be204713107626f3e334e9fd5974c044a9f2ffb6 | [
"MIT"
] | null | null | null | lib/tests/test_bitcoin.py | D3m0nKingx/electrum-ganja | be204713107626f3e334e9fd5974c044a9f2ffb6 | [
"MIT"
] | null | null | null | import base64
import unittest
import sys
from lib import bitcoin
from lib.bitcoin import (
public_key_to_p2pkh,
bip32_root, bip32_public_derivation, bip32_private_derivation,
Hash, address_from_private_key,
is_address, is_private_key, xpub_from_xprv, is_new_seed, is_old_seed,
var_int, op_push, addr... | 52.664756 | 1,378 | 0.707671 | import base64
import unittest
import sys
from lib import bitcoin
from lib.bitcoin import (
public_key_to_p2pkh,
bip32_root, bip32_public_derivation, bip32_private_derivation,
Hash, address_from_private_key,
is_address, is_private_key, xpub_from_xprv, is_new_seed, is_old_seed,
var_int, op_push, addr... | true | true |
1c34f71509c416f907057a5acc2be974f7718754 | 233 | py | Python | napari/_qt/layers/qt_pyramid_layer.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/layers/qt_pyramid_layer.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | 1 | 2019-09-18T22:59:55.000Z | 2019-09-23T16:41:08.000Z | napari/_qt/layers/qt_pyramid_layer.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | null | null | null | from ...layers import Pyramid
from .qt_image_layer import QtImageControls, QtImageProperties
class QtPyramidControls(QtImageControls, layer=Pyramid):
pass
class QtPyramidProperties(QtImageProperties, layer=Pyramid):
pass
| 21.181818 | 62 | 0.811159 | from ...layers import Pyramid
from .qt_image_layer import QtImageControls, QtImageProperties
class QtPyramidControls(QtImageControls, layer=Pyramid):
pass
class QtPyramidProperties(QtImageProperties, layer=Pyramid):
pass
| true | true |
1c34f7365ae533c7a016c65aaf031f4281d86efd | 1,955 | py | Python | PyObjCTest/test_nsanimation.py | Khan/pyobjc-framework-Cocoa | f8b015ea2a72d8d78be6084fb12925c4785b8f1f | [
"MIT"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsanimation.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsanimation.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z |
from PyObjCTools.TestSupport import *
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSAnimationHelper (NSObject):
def animationShouldStart_(self, animation): return 1
def animation_valueForProgress_(self, a, b): return 1
def animation_didReachProgressMark_(self, a, b... | 38.333333 | 100 | 0.767263 |
from PyObjCTools.TestSupport import *
from AppKit import *
try:
unicode
except NameError:
unicode = str
class TestNSAnimationHelper (NSObject):
def animationShouldStart_(self, animation): return 1
def animation_valueForProgress_(self, a, b): return 1
def animation_didReachProgressMark_(self, a, b... | true | true |
1c34f80eecfcae2605ef92175008884d8d327424 | 7,303 | py | Python | research/slim/nets/nets_factory.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 153 | 2020-10-25T13:58:04.000Z | 2022-03-07T06:01:54.000Z | research/slim/nets/nets_factory.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 11 | 2020-07-13T08:29:00.000Z | 2022-03-24T07:21:09.000Z | research/slim/nets/nets_factory.py | 873040/Abhishek | 2ddd716e66bc5cc6e6f0787508dd07da0e02e75a | [
"Apache-2.0"
] | 23 | 2020-10-25T14:44:47.000Z | 2021-03-31T02:12:13.000Z | # 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 applicable ... | 42.213873 | 80 | 0.751061 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
from tensorflow.contrib import slim as contrib_slim
from nets import alexnet
from nets import cifarnet
from nets import i3d
from nets import inception
from nets import lenet
from... | true | true |
1c34f8473405ca66b16aa4edaae04cd633afb328 | 8,327 | py | Python | bin/redsea/tidal_api.py | SultanSGillani/dotfiles | 17705501de7c72399656f909f06746700d5f04cd | [
"0BSD"
] | 7 | 2020-02-10T03:07:05.000Z | 2022-02-03T20:50:31.000Z | bin/redsea/tidal_api.py | SultanSGillani/dotfiles | 17705501de7c72399656f909f06746700d5f04cd | [
"0BSD"
] | 2 | 2020-07-18T14:42:36.000Z | 2022-01-20T14:41:03.000Z | bin/redsea/tidal_api.py | SultanSGillani/dotfiles | 17705501de7c72399656f909f06746700d5f04cd | [
"0BSD"
] | 1 | 2018-11-27T16:51:10.000Z | 2018-11-27T16:51:10.000Z | import pickle
import uuid
import os
import requests
class TidalRequestError(Exception):
def __init__(self, payload):
sf = '{subStatus}: {userMessage} (HTTP {status})'.format(**payload)
self.payload = payload
super(TidalRequestError, self).__init__(sf)
class TidalError(Exception):
d... | 33.175299 | 130 | 0.593491 | import pickle
import uuid
import os
import requests
class TidalRequestError(Exception):
def __init__(self, payload):
sf = '{subStatus}: {userMessage} (HTTP {status})'.format(**payload)
self.payload = payload
super(TidalRequestError, self).__init__(sf)
class TidalError(Exception):
d... | true | true |
1c34f8a2fde5ba30697a03d4b7f7701e4cce5000 | 455 | py | Python | beer/cli/subcommands/hmm/phonelist.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | 46 | 2018-02-27T18:15:08.000Z | 2022-02-16T22:10:55.000Z | beer/cli/subcommands/hmm/phonelist.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | 16 | 2018-01-26T14:18:51.000Z | 2021-02-05T09:34:00.000Z | beer/cli/subcommands/hmm/phonelist.py | RobinAlgayres/beer | 15ad0dad5a49f98e658e948724e05df347ffe3b8 | [
"MIT"
] | 26 | 2018-03-12T14:03:26.000Z | 2021-05-24T21:15:01.000Z |
'print the list of phones from a set of phones\' HMM'
import argparse
import pickle
from natsort import natsorted
def setup(parser):
parser.add_argument('hmms', help='phones\' hmms')
def main(args, logger):
logger.debug('loading the HMMs...')
with open(args.hmms, 'rb') as f:
units, _ = pickle... | 17.5 | 64 | 0.643956 |
import argparse
import pickle
from natsort import natsorted
def setup(parser):
parser.add_argument('hmms', help='phones\' hmms')
def main(args, logger):
logger.debug('loading the HMMs...')
with open(args.hmms, 'rb') as f:
units, _ = pickle.load(f)
for key in natsorted(units.keys(), key=l... | true | true |
1c34f94acc478114b177c4f1e4daaf1402f8de8f | 27 | py | Python | testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py | markshao/pytest | 611b579d21f7e62b4c8ed54ab70fbfee7c6f5f64 | [
"MIT"
] | 9,225 | 2015-06-15T21:56:14.000Z | 2022-03-31T20:47:38.000Z | testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py | markshao/pytest | 611b579d21f7e62b4c8ed54ab70fbfee7c6f5f64 | [
"MIT"
] | 7,794 | 2015-06-15T21:06:34.000Z | 2022-03-31T10:56:54.000Z | testing/example_scripts/fixtures/fill_fixtures/test_conftest_funcargs_only_available_in_subdir/sub2/test_in_sub2.py | markshao/pytest | 611b579d21f7e62b4c8ed54ab70fbfee7c6f5f64 | [
"MIT"
] | 2,598 | 2015-06-15T21:42:39.000Z | 2022-03-29T13:48:22.000Z | def test_2(arg2):
pass
| 9 | 17 | 0.62963 | def test_2(arg2):
pass
| true | true |
1c34fcb4d73d6021d2acb6af49703d7f1211b96d | 1,634 | py | Python | content/migrations/0046_auto_20210401_0016.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | content/migrations/0046_auto_20210401_0016.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | content/migrations/0046_auto_20210401_0016.py | bikramtuladhar/covid-19-procurement-explorer-admin | 9bba473c8b83c8651e3178b6fba01af74d8b27dc | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.7 on 2021-04-01 00:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('country', '0030_auto_20210331_1526'),
('content', '0045_auto_20210331_1526'),
]
operations = [
migr... | 35.521739 | 125 | 0.617503 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('country', '0030_auto_20210331_1526'),
('content', '0045_auto_20210331_1526'),
]
operations = [
migrations.AlterField(
model_name='data... | true | true |
1c34fce2b3dc9d70b87850dfff00fb1971f911c0 | 1,568 | py | Python | python/zenhub-backup.py | open-cluster-management/zenhub-backup | b6811cbb01879e9a5de6d1490ac25d2a3c734fea | [
"Apache-2.0"
] | 4 | 2021-05-21T22:06:50.000Z | 2021-06-21T14:43:32.000Z | python/zenhub-backup.py | open-cluster-management/zenhub-backup | b6811cbb01879e9a5de6d1490ac25d2a3c734fea | [
"Apache-2.0"
] | null | null | null | python/zenhub-backup.py | open-cluster-management/zenhub-backup | b6811cbb01879e9a5de6d1490ac25d2a3c734fea | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from zenhub import Zenhub # the move issue API failed; fellback on requests library
import json
import os
# Update these variables with the project settings
ZENHUB_API = 'https://api.zenhub.com'
ZENHUB_API_TOKEN = os.getenv('ZENHUB_API_TOKEN')
GITHUB_REPO_ID = os.getenv('GITHUB_REPO_ID')
ZENHUB_... | 39.2 | 144 | 0.765306 |
from zenhub import Zenhub
import json
import os
ZENHUB_API = 'https://api.zenhub.com'
ZENHUB_API_TOKEN = os.getenv('ZENHUB_API_TOKEN')
GITHUB_REPO_ID = os.getenv('GITHUB_REPO_ID')
ZENHUB_WORKSPACE_ID = os.getenv('ZENHUB_WORKSPACE_ID')
AUTH_HEADER = {'X-Authentication-Token': '%s' % ZENHUB_API_TOKEN}
ZENHUB_BOARD_J... | true | true |
1c34fcfaddccb2b4050adc99174f6ef631ed2ae8 | 26,232 | py | Python | pyclustering/nnet/hhn.py | JosephChataignon/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 1,013 | 2015-01-26T19:50:14.000Z | 2022-03-31T07:38:48.000Z | pyclustering/nnet/hhn.py | peterlau0626/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 542 | 2015-01-20T16:44:32.000Z | 2022-01-29T14:57:20.000Z | pyclustering/nnet/hhn.py | peterlau0626/pyclustering | bf4f51a472622292627ec8c294eb205585e50f52 | [
"BSD-3-Clause"
] | 262 | 2015-03-19T07:28:12.000Z | 2022-03-30T07:28:24.000Z | """!
@brief Oscillatory Neural Network based on Hodgkin-Huxley Neuron Model
@details Implementation based on paper @cite article::nnet::hnn::1.
@authors Andrei Novikov (pyclustering@yandex.ru)
@date 2014-2020
@copyright BSD-3-Clause
"""
from scipy.integrate import odeint
from pyclustering.core.wrapper... | 47.521739 | 231 | 0.617986 |
from scipy.integrate import odeint
from pyclustering.core.wrapper import ccore_library
import pyclustering.core.hhn_wrapper as wrapper
from pyclustering.nnet import *
from pyclustering.utils import allocate_sync_ensembles
import numpy
import random
class hhn_parameters:
def __init__(self... | true | true |
1c34fea6f6c6e1fd5aa8b7f48311502477397d42 | 1,693 | py | Python | build/find_depot_tools.py | TwistedCore/external_v8 | c6725dab9be251fbfc6fd7d53c3513a23e78c36c | [
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | build/find_depot_tools.py | TwistedCore/external_v8 | c6725dab9be251fbfc6fd7d53c3513a23e78c36c | [
"BSD-3-Clause"
] | 241 | 2016-01-27T15:37:56.000Z | 2016-09-09T07:34:07.000Z | build/find_depot_tools.py | TwistedCore/external_v8 | c6725dab9be251fbfc6fd7d53c3513a23e78c36c | [
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can... | 27.754098 | 76 | 0.722386 |
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
imports breakpad.
This can also be used as a standalone script to print out the depot_tools
directory location.
"""
import os
import sys
def IsRealDepotTools(p... | false | true |
1c34ff459644f5dd3812472989b58fef5b5d706d | 4,744 | py | Python | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 1 | 2020-03-05T18:10:35.000Z | 2020-03-05T18:10:35.000Z | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | 2 | 2020-03-03T23:11:13.000Z | 2020-03-30T18:50:55.000Z | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/aio/operations/_operations.py | adewaleo/azure-sdk-for-python | 169457edbea5e3c5557246cfcf8bd635d528bae4 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.754717 | 133 | 0.660835 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
1c34ff63a8b9e3f11d2b2c93327b77046e395fa0 | 2,579 | py | Python | chaosoci/core/networking/filters.py | LaudateCorpus1/chaostoolkit-oci | 36da01a47dd1b0881ec21cb70775fde5011b38ed | [
"Apache-2.0"
] | 15 | 2018-11-20T15:36:52.000Z | 2021-12-16T21:46:56.000Z | chaosoci/core/networking/filters.py | LaudateCorpus1/chaostoolkit-oci | 36da01a47dd1b0881ec21cb70775fde5011b38ed | [
"Apache-2.0"
] | 21 | 2018-11-26T19:11:52.000Z | 2021-12-15T19:38:37.000Z | chaosoci/core/networking/filters.py | LaudateCorpus1/chaostoolkit-oci | 36da01a47dd1b0881ec21cb70775fde5011b38ed | [
"Apache-2.0"
] | 8 | 2018-11-20T15:37:09.000Z | 2021-07-28T20:27:19.000Z | # coding: utf-8
# Copyright 2020, Oracle Corporation and/or its affiliates.
__all__ = ["filter_route_tables", "filter_nat_gateway", "filter_service_gateway", "filter_internet_gateway"]
from typing import Any, Dict, List
from chaoslib.exceptions import ActivityFailed
from chaosoci.util.constants import FILTER_ERR
fr... | 33.493506 | 108 | 0.691741 |
__all__ = ["filter_route_tables", "filter_nat_gateway", "filter_service_gateway", "filter_internet_gateway"]
from typing import Any, Dict, List
from chaoslib.exceptions import ActivityFailed
from chaosoci.util.constants import FILTER_ERR
from logzero import logger
from oci.core import VirtualNetworkClient
from o... | true | true |
1c34ffd069311c30480e2a2287d5535272434e89 | 259 | py | Python | vr/server/templatetags/formfield.py | isabella232/vr.server | 705511f8176bda0627be1ae86a458178589ee3db | [
"MIT"
] | null | null | null | vr/server/templatetags/formfield.py | isabella232/vr.server | 705511f8176bda0627be1ae86a458178589ee3db | [
"MIT"
] | 3 | 2016-12-15T21:55:02.000Z | 2019-02-13T11:43:29.000Z | vr/server/templatetags/formfield.py | isabella232/vr.server | 705511f8176bda0627be1ae86a458178589ee3db | [
"MIT"
] | 2 | 2017-01-16T09:31:03.000Z | 2022-03-26T09:21:36.000Z | from django import template
register = template.Library()
# Allow rendering formfields with our custom template include by saying
# {% formfield form.somefield %}
@register.inclusion_tag('_formfield.html')
def formfield(field):
return {'field': field}
| 23.545455 | 71 | 0.760618 | from django import template
register = template.Library()
@register.inclusion_tag('_formfield.html')
def formfield(field):
return {'field': field}
| true | true |
1c34ffde69a6a33cef6377790d2deabc7d07eadf | 6,945 | py | Python | research/maskgan/models/rnn_zaremba.py | afish880/TensorTest | a41f00ac171cf53539b4e2de47f2e15ccb848c90 | [
"Apache-2.0"
] | 1 | 2019-02-04T02:44:37.000Z | 2019-02-04T02:44:37.000Z | research/maskgan/models/rnn_zaremba.py | afish880/TensorTest | a41f00ac171cf53539b4e2de47f2e15ccb848c90 | [
"Apache-2.0"
] | null | null | null | research/maskgan/models/rnn_zaremba.py | afish880/TensorTest | a41f00ac171cf53539b4e2de47f2e15ccb848c90 | [
"Apache-2.0"
] | 1 | 2021-05-08T11:27:53.000Z | 2021-05-08T11:27:53.000Z | # 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 applicab... | 35.433673 | 80 | 0.624478 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def generator(hparams,
inputs,
targets,
targets_present,
is_training,
... | true | true |
1c34ffdf0a8f2df4e093502469131b05bf3711df | 9,387 | py | Python | ibmcnx/config/j2ee/RoleAllUnrestricted.py | stoeps13/ibmcnx2 | 14e3387e0b5726afbb094b9be5016f47e830362a | [
"Apache-2.0"
] | 11 | 2015-03-07T14:09:43.000Z | 2022-03-16T07:31:55.000Z | ibmcnx/config/j2ee/RoleAllUnrestricted.py | stoeps13/ibmcnx2 | 14e3387e0b5726afbb094b9be5016f47e830362a | [
"Apache-2.0"
] | null | null | null | ibmcnx/config/j2ee/RoleAllUnrestricted.py | stoeps13/ibmcnx2 | 14e3387e0b5726afbb094b9be5016f47e830362a | [
"Apache-2.0"
] | 9 | 2015-03-04T16:50:46.000Z | 2020-05-22T05:31:27.000Z | '''
Set all Roles to Unrestricted - anonymous access possible
Description:
Script is tested with HCL Connections 4.5 CR2
You have to edit the variables and set them to your administrative Accounts
Author: Klaus Bild
Blog: http://www.kbild.ch
E-Mail:
Documentation: http://scripting101.stoeps.de
Version: ... | 47.409091 | 342 | 0.636092 | '''
Set all Roles to Unrestricted - anonymous access possible
Description:
Script is tested with HCL Connections 4.5 CR2
You have to edit the variables and set them to your administrative Accounts
Author: Klaus Bild
Blog: http://www.kbild.ch
E-Mail:
Documentation: http://scripting101.stoeps.de
Version: ... | false | true |
1c350009e0a7420971ced657135ace27ba273c39 | 7,212 | py | Python | lesson13/sunzhaohui/reboot/users/group/__init__.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson13/sunzhaohui/reboot/users/group/__init__.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | lesson13/sunzhaohui/reboot/users/group/__init__.py | herrywen-nanj/51reboot | 1130c79a360e1b548a6eaad176eb60f8bed22f40 | [
"Apache-2.0"
] | null | null | null | # _*_ encoding:utf-8 _*_
__author__ = 'sunzhaohui'
__date__ = '2019-08-05 17:20'
from django.shortcuts import render
from django.http import HttpResponse,QueryDict,HttpResponseRedirect,JsonResponse,Http404
from django.urls import reverse
from django.conf import settings
from users.models import UserProfile
from djan... | 37.5625 | 106 | 0.631725 |
__author__ = 'sunzhaohui'
__date__ = '2019-08-05 17:20'
from django.shortcuts import render
from django.http import HttpResponse,QueryDict,HttpResponseRedirect,JsonResponse,Http404
from django.urls import reverse
from django.conf import settings
from users.models import UserProfile
from django.contrib.auth.models i... | true | true |
1c350203e6d8985a8b2b61ffaaafac8504e26b3e | 1,208 | py | Python | nipype/interfaces/tests/test_auto_SSHDataGrabber.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/tests/test_auto_SSHDataGrabber.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/tests/test_auto_SSHDataGrabber.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..io import SSHDataGrabber
def test_SSHDataGrabber_inputs():
input_map = dict(base_directory=dict(mandatory=True,
),
download_files=dict(usedefault=True,
),
hostname=dict(mandatory=True,
),
i... | 26.844444 | 67 | 0.672185 |
from __future__ import unicode_literals
from ..io import SSHDataGrabber
def test_SSHDataGrabber_inputs():
input_map = dict(base_directory=dict(mandatory=True,
),
download_files=dict(usedefault=True,
),
hostname=dict(mandatory=True,
),
ignore_exception=dict(deprecated='1.0.0',
nohash=T... | true | true |
1c3502398c0fb7fe2dc6975eb1f77e0bbc5b81ed | 4,624 | py | Python | timesmoothing.py | Numlet/pgw-python | 1731fccdd0d3a3a199246fdc6dc04058273237ab | [
"MIT"
] | 2 | 2020-11-13T09:22:06.000Z | 2021-11-13T14:50:50.000Z | timesmoothing.py | Numlet/pgw-python | 1731fccdd0d3a3a199246fdc6dc04058273237ab | [
"MIT"
] | null | null | null | timesmoothing.py | Numlet/pgw-python | 1731fccdd0d3a3a199246fdc6dc04058273237ab | [
"MIT"
] | 2 | 2020-12-07T09:34:07.000Z | 2021-06-23T08:39:38.000Z | # -*- coding: utf-8 -*-
#from settings import annualcycleraw, variablename_to_smooth, outputpath
import xarray as xr
import numpy as np
import sys
import math
from pathlib import Path
def filterdata(annualcycleraw, variablename_to_smooth, outputpath):
"""
This function performs a temporal smoothing of an annual ti... | 35.030303 | 157 | 0.721453 |
import xarray as xr
import numpy as np
import sys
import math
from pathlib import Path
def filterdata(annualcycleraw, variablename_to_smooth, outputpath):
Diff = xr.open_dataset(annualcycleraw)[variablename_to_smooth].squeeze()
coords = Diff.coords
print('Dimension that is assumed to be time dimension is call... | true | true |
1c35024bbad0f44318da90414d0b5f6b0469348a | 5,416 | py | Python | tests/wallet/did_wallet/test_did_rpc.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 11 | 2021-11-10T19:30:12.000Z | 2022-02-09T04:30:29.000Z | tests/wallet/did_wallet/test_did_rpc.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 6 | 2021-11-16T17:11:03.000Z | 2021-12-28T17:11:20.000Z | tests/wallet/did_wallet/test_did_rpc.py | ethgreen/ethgreen-blockchain | 8f1a450897ab7a82326aea7e57e18ac2c03a9e83 | [
"Apache-2.0"
] | 3 | 2021-11-21T02:27:10.000Z | 2022-03-15T08:34:47.000Z | import asyncio
import logging
import pytest
from ethgreen.rpc.rpc_server import start_rpc_server
from ethgreen.rpc.wallet_rpc_api import WalletRpcApi
from ethgreen.rpc.wallet_rpc_client import WalletRpcClient
from ethgreen.simulator.simulator_protocol import FarmNewBlockProtocol
from ethgreen.types.peer_info import Pe... | 40.41791 | 105 | 0.6887 | import asyncio
import logging
import pytest
from ethgreen.rpc.rpc_server import start_rpc_server
from ethgreen.rpc.wallet_rpc_api import WalletRpcApi
from ethgreen.rpc.wallet_rpc_client import WalletRpcClient
from ethgreen.simulator.simulator_protocol import FarmNewBlockProtocol
from ethgreen.types.peer_info import Pe... | true | true |
1c3502b00816b1391aa44c72e9fff9864542562e | 1,579 | py | Python | dfd/api.py | legnaleurc/dfd | 50f580c4cf2d6528a6df8310093aef2b0b7f2c08 | [
"MIT"
] | null | null | null | dfd/api.py | legnaleurc/dfd | 50f580c4cf2d6528a6df8310093aef2b0b7f2c08 | [
"MIT"
] | null | null | null | dfd/api.py | legnaleurc/dfd | 50f580c4cf2d6528a6df8310093aef2b0b7f2c08 | [
"MIT"
] | null | null | null | import json
from aiohttp import web as aw
from .database import InvalidFilterError
# NOTE we dont expect filters will be large text
class FiltersHandler(aw.View):
async def post(self):
filters = self.request.app['filters']
new_filter = await self.request.text()
try:
new_id =... | 28.709091 | 68 | 0.59658 | import json
from aiohttp import web as aw
from .database import InvalidFilterError
class FiltersHandler(aw.View):
async def post(self):
filters = self.request.app['filters']
new_filter = await self.request.text()
try:
new_id = await filters.add(new_filter)
except In... | true | true |
1c3503919c84d443d05169a5103bf543a789cea3 | 22,676 | py | Python | scripts/obtain_data.py | quimaguirre/NetworkAnalysis | c7a4da3ba5696800738b4767065ce29fa0020d79 | [
"MIT"
] | 1 | 2017-07-10T17:33:31.000Z | 2017-07-10T17:33:31.000Z | scripts/obtain_data.py | quimaguirre/NetworkAnalysis | c7a4da3ba5696800738b4767065ce29fa0020d79 | [
"MIT"
] | null | null | null | scripts/obtain_data.py | quimaguirre/NetworkAnalysis | c7a4da3ba5696800738b4767065ce29fa0020d79 | [
"MIT"
] | null | null | null | import argparse
import ConfigParser
import cPickle
import mysql.connector
import networkx as nx
import sys, os, re
from context import NetworkAnalysis
import NetworkAnalysis.drug as NA_drug
"""
NetworkAnalysis
2017 Joaquim Aguirre-Plans
Structural Bioinformatics Laboratory
Universitat Pompeu Fabra
""... | 37.480992 | 450 | 0.66233 | import argparse
import ConfigParser
import cPickle
import mysql.connector
import networkx as nx
import sys, os, re
from context import NetworkAnalysis
import NetworkAnalysis.drug as NA_drug
def main():
options = parse_user_arguments()
create_tissue_specific_network(options)
def parse_user_arguments(*args,... | true | true |
1c3504f81075d5cdf675fc34b13c33b452655f06 | 1,919 | py | Python | test_scripts/imutest.py | sofwerx/dataglove | e49d72bef23fcba840e67fabc2fb81ce9f91b775 | [
"MIT"
] | 5 | 2019-05-07T17:28:20.000Z | 2020-06-18T15:08:04.000Z | test_scripts/imutest.py | sofwerx/dataglove | e49d72bef23fcba840e67fabc2fb81ce9f91b775 | [
"MIT"
] | 1 | 2019-08-29T22:54:07.000Z | 2019-08-29T23:03:57.000Z | test_scripts/imutest.py | sofwerx/dataglove | e49d72bef23fcba840e67fabc2fb81ce9f91b775 | [
"MIT"
] | 2 | 2019-05-28T13:11:09.000Z | 2019-06-05T17:47:28.000Z | import serial
import time
import sys
import threading
import numpy as np
# © 2019 BeBop Sensors, Inc.
data = []
class GloveSerialListener(threading.Thread):
def __init__(self, port):
threading.Thread.__init__(self)
self.glove = serial.Serial()
self.glove.baudrate = 460800
self.glo... | 21.561798 | 59 | 0.5284 | import serial
import time
import sys
import threading
import numpy as np
data = []
class GloveSerialListener(threading.Thread):
def __init__(self, port):
threading.Thread.__init__(self)
self.glove = serial.Serial()
self.glove.baudrate = 460800
self.glove.port = '/dev/rfcomm0'
... | true | true |
1c35065379e7fecc69342e3601f2049d6fbe96f9 | 514 | py | Python | other/abnormal_sample_detection/scripts/calculate_sampleAB.py | fabiodepa/ForestQC | aba6d0f2f6925c62229bd01ace7370be314f5886 | [
"MIT"
] | 21 | 2018-10-18T08:56:04.000Z | 2022-01-15T10:18:52.000Z | other/abnormal_sample_detection/scripts/calculate_sampleAB.py | fabiodepa/ForestQC | aba6d0f2f6925c62229bd01ace7370be314f5886 | [
"MIT"
] | 7 | 2018-10-25T23:50:12.000Z | 2022-01-26T17:44:11.000Z | other/abnormal_sample_detection/scripts/calculate_sampleAB.py | fabiodepa/ForestQC | aba6d0f2f6925c62229bd01ace7370be314f5886 | [
"MIT"
] | 7 | 2018-11-21T10:32:56.000Z | 2021-09-16T05:26:08.000Z | from sample_level_vcf_stat import *
import os
import sys
import pandas as pd
# sample = os.listdir('/u/home/k/k8688933/Jaehoon/data')
# good_variants_rsid_file = '/u/scratch2/k/k8688933/stat_output/vqsr_qc4/good.all.clfB.rsid'
vcf_file = sys.argv[1]
outfile = sys.argv[2]
# list_ = []
# with open(good_variants_rsid_fi... | 25.7 | 92 | 0.719844 | from sample_level_vcf_stat import *
import os
import sys
import pandas as pd
vcf_file = sys.argv[1]
outfile = sys.argv[2]
sample_ab = sampleLevelAB([vcf_file])
ab = pd.DataFrame(sample_ab)
ab.to_csv(outfile)
| true | true |
1c35067aafd2936571b8659c35155dc178d8e7d5 | 815 | py | Python | app/models/loginUserSchema.py | SE-4398/Slither | 2d3a196329250cdd1f09e472b5b6de05de6c24cb | [
"Unlicense",
"MIT"
] | 1 | 2020-05-25T20:47:48.000Z | 2020-05-25T20:47:48.000Z | app/models/loginUserSchema.py | SE-4398/Slither | 2d3a196329250cdd1f09e472b5b6de05de6c24cb | [
"Unlicense",
"MIT"
] | 8 | 2020-04-16T01:50:47.000Z | 2020-10-22T14:51:32.000Z | app/models/loginUserSchema.py | SE-4398/Slither | 2d3a196329250cdd1f09e472b5b6de05de6c24cb | [
"Unlicense",
"MIT"
] | 1 | 2020-05-21T05:54:21.000Z | 2020-05-21T05:54:21.000Z | import datetime
from click import DateTime
from flask import Flask, render_template, request
# from flask_mysqldb import MySQL
# import pymysql
# import yaml
from flask_wtf import FlaskForm, RecaptchaField
from wtforms import StringField, IntegerField, DateField, DecimalField, SubmitField, PasswordField, BooleanField,... | 37.045455 | 115 | 0.788957 | import datetime
from click import DateTime
from flask import Flask, render_template, request
from flask_wtf import FlaskForm, RecaptchaField
from wtforms import StringField, IntegerField, DateField, DecimalField, SubmitField, PasswordField, BooleanField, \
DateTimeField
from datetime import datetime
from wtform... | true | true |
1c3506c1d1436bd754bfb43ddce7129a383c968f | 928 | py | Python | src/ploomber/tasks/__init__.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 2,141 | 2020-02-14T02:34:34.000Z | 2022-03-31T22:43:20.000Z | src/ploomber/tasks/__init__.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 660 | 2020-02-06T16:15:57.000Z | 2022-03-31T22:55:01.000Z | src/ploomber/tasks/__init__.py | MarcoJHB/ploomber | 4849ef6915572f7934392443b4faf138172b9596 | [
"Apache-2.0"
] | 122 | 2020-02-14T18:53:05.000Z | 2022-03-27T22:33:24.000Z | from ploomber.tasks.tasks import (PythonCallable, ShellScript, DownloadFromURL,
Link, Input, task_factory)
from ploomber.tasks.taskfactory import TaskFactory
from ploomber.tasks.sql import (SQLScript, SQLDump, SQLTransfer, SQLUpload,
PostgresCopyFrom)
fr... | 29 | 79 | 0.6875 | from ploomber.tasks.tasks import (PythonCallable, ShellScript, DownloadFromURL,
Link, Input, task_factory)
from ploomber.tasks.taskfactory import TaskFactory
from ploomber.tasks.sql import (SQLScript, SQLDump, SQLTransfer, SQLUpload,
PostgresCopyFrom)
fr... | true | true |
1c3507a628143c1371019fd50632146e96f30fbd | 54,445 | py | Python | numpy/lib/tests/test_arraypad.py | jcw780/numpy | 1912db21e0f5e61739168864f6b1f37dff3b4006 | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/tests/test_arraypad.py | jcw780/numpy | 1912db21e0f5e61739168864f6b1f37dff3b4006 | [
"BSD-3-Clause"
] | null | null | null | numpy/lib/tests/test_arraypad.py | jcw780/numpy | 1912db21e0f5e61739168864f6b1f37dff3b4006 | [
"BSD-3-Clause"
] | null | null | null | """Tests for the array padding functions.
"""
from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from numpy.lib.arraypad import _as_pairs
_numeric_dtypes = (
np.sctypes["uint"]
+ np.sc... | 39.828091 | 79 | 0.424502 | from __future__ import division, absolute_import, print_function
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from numpy.lib.arraypad import _as_pairs
_numeric_dtypes = (
np.sctypes["uint"]
+ np.sctypes["int"]
+ np.sctypes["float"]
+ np... | true | true |
1c35083ca706d19d0feb217060347edb2b8f5fbd | 16,038 | py | Python | tenkit/lib/python/tenkit/fasta.py | qiangli/cellranger | 046e24c3275cfbd4516a6ebc064594513a5c45b7 | [
"MIT"
] | 1 | 2019-03-29T04:05:58.000Z | 2019-03-29T04:05:58.000Z | tenkit/lib/python/tenkit/fasta.py | qiangli/cellranger | 046e24c3275cfbd4516a6ebc064594513a5c45b7 | [
"MIT"
] | null | null | null | tenkit/lib/python/tenkit/fasta.py | qiangli/cellranger | 046e24c3275cfbd4516a6ebc064594513a5c45b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2014 10X Genomics, Inc. All rights reserved.
#
# Utilities for manipulating fasta and fastq files
#
import glob
import gzip
import numpy
import os
import re
import sys
from tenkit.constants import ILLUMINA_QUAL_OFFSET, BCL_PROCESSOR_FASTQ_MODE, ILMN_BCL2FASTQ_FASTQ_MODE
# Pars... | 38.095012 | 513 | 0.644906 |
import glob
import gzip
import numpy
import os
import re
import sys
from tenkit.constants import ILLUMINA_QUAL_OFFSET, BCL_PROCESSOR_FASTQ_MODE, ILMN_BCL2FASTQ_FASTQ_MODE
class IlmnFastqFile:
def __init__(self, fullpath):
fn = os.path.split(fullpath)[-1]
dot_parts = fn.split(".")
... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.