hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72a6cb5cc483a8ad619bf7be7299edfe87310a0 | 592 | py | Python | testing/test_is_infected.py | GalBenZvi/EpidemicSimulation | 7aa551e18ad27e977a73452e708026ea85804a21 | [
"MIT"
] | 1 | 2020-07-15T07:11:55.000Z | 2020-07-15T07:11:55.000Z | testing/test_is_infected.py | Hershkovitz-hub/EpidemicSimulation | 7aa551e18ad27e977a73452e708026ea85804a21 | [
"MIT"
] | 2 | 2021-06-08T22:07:26.000Z | 2021-09-08T02:22:40.000Z | testing/test_is_infected.py | GalBenZvi/EpidemicSimulation | 7aa551e18ad27e977a73452e708026ea85804a21 | [
"MIT"
] | null | null | null | from epidemic_simulation.simulation import SimulationManager
import pytest
@pytest.fixture
def test_data():
test_calc=SimulationManager([],{'infection_r':100,'infection_p':0.99,'sickness_duration':6})
return test_calc
def test_infection_prob_between_0_1(test_data):
"""
infection_prob must be between 0... | 26.909091 | 96 | 0.682432 | from epidemic_simulation.simulation import SimulationManager
import pytest
@pytest.fixture
def test_data():
test_calc=SimulationManager([],{'infection_r':100,'infection_p':0.99,'sickness_duration':6})
return test_calc
def test_infection_prob_between_0_1(test_data):
try:
test_data.infection_prob=-0... | true | true |
f72a6dcb2a0ebf8ec3765416a9db9ad3c3e0ae5e | 1,253 | py | Python | src/lm/metrics.py | source-data/soda-roberta | 28f23ae68a1bb17c9844815a7c36d4c590e8c3d0 | [
"MIT"
] | 3 | 2021-04-23T05:06:23.000Z | 2021-09-03T21:10:25.000Z | src/lm/metrics.py | source-data/soda-roberta | 28f23ae68a1bb17c9844815a7c36d4c590e8c3d0 | [
"MIT"
] | 1 | 2021-12-14T15:21:16.000Z | 2021-12-14T15:21:16.000Z | src/lm/metrics.py | source-data/soda-roberta | 28f23ae68a1bb17c9844815a7c36d4c590e8c3d0 | [
"MIT"
] | 1 | 2022-03-29T08:03:25.000Z | 2022-03-29T08:03:25.000Z | from transformers import EvalPrediction
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
def compute_metrics(pred: EvalPrediction):
"""Compute recall at the masked position
"""
mask = pred.label_ids != -100
# filter everything except the masked position and flatten tensor... | 31.325 | 99 | 0.581006 | from transformers import EvalPrediction
from sklearn.metrics import precision_recall_fscore_support
import numpy as np
def compute_metrics(pred: EvalPrediction):
mask = pred.label_ids != -100
labels = pred.label_ids[mask].flatten()
preds = pred.predictions[mask].flatten()
_, recall, _, _ = precis... | true | true |
f72a6ec3d3794ebec344131fa4c80510f1e78360 | 2,375 | py | Python | VORDInstance.py | Daviddddl/i3d_pytorch | 595172379bc669a30468119f629180141c2cbae2 | [
"Apache-2.0"
] | 3 | 2019-03-15T14:28:57.000Z | 2020-06-18T04:00:46.000Z | VORDInstance.py | Daviddddl/i3d_pytorch | 595172379bc669a30468119f629180141c2cbae2 | [
"Apache-2.0"
] | 1 | 2020-04-01T22:24:07.000Z | 2020-04-01T22:24:07.000Z | VORDInstance.py | Daviddddl/I3D_pytorch | 595172379bc669a30468119f629180141c2cbae2 | [
"Apache-2.0"
] | null | null | null |
class VORDInstance:
def __init__(self, video_id, video_path, frame_count, fps, width, height,
subject_objects, trajectories, relation_instances):
self.video_id = video_id
self.video_path = video_path
self.frame_count = frame_count
self.fps = fps
self.height... | 36.538462 | 77 | 0.586105 |
class VORDInstance:
def __init__(self, video_id, video_path, frame_count, fps, width, height,
subject_objects, trajectories, relation_instances):
self.video_id = video_id
self.video_path = video_path
self.frame_count = frame_count
self.fps = fps
self.height... | true | true |
f72a6f1a0b1f6bc7143103cd94ad22fb05c13141 | 334 | py | Python | school/extensions.py | leyyin/university-SE | 7cc3625bda787d2e79ab22f30d6f6e732ca9abb3 | [
"MIT"
] | 3 | 2015-03-12T15:50:58.000Z | 2015-05-04T12:55:19.000Z | school/extensions.py | leyyin/university-SE | 7cc3625bda787d2e79ab22f30d6f6e732ca9abb3 | [
"MIT"
] | 2 | 2015-05-01T18:24:04.000Z | 2015-05-15T15:58:47.000Z | school/extensions.py | leyyin/university-SE | 7cc3625bda787d2e79ab22f30d6f6e732ca9abb3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# init all the extensions instances
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.login import LoginManager
login_manager = LoginManager()
from flask_debugtoolbar import DebugToolbarExtension
toolbar = DebugToolb... | 18.555556 | 52 | 0.778443 |
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.login import LoginManager
login_manager = LoginManager()
from flask_debugtoolbar import DebugToolbarExtension
toolbar = DebugToolbarExtension()
| true | true |
f72a7184ee9e741944510976bfd4ac5d2d98ed14 | 9,090 | py | Python | tectosaur/fmm/ts_terms.py | jlmaurer/tectosaur | 7cc5606d814f061395b19754e7a4b6c5e4c236e5 | [
"MIT"
] | 17 | 2017-06-29T16:48:56.000Z | 2021-10-03T18:31:41.000Z | tectosaur/fmm/ts_terms.py | jlmaurer/tectosaur | 7cc5606d814f061395b19754e7a4b6c5e4c236e5 | [
"MIT"
] | 4 | 2018-05-29T08:21:13.000Z | 2021-04-01T01:28:50.000Z | tectosaur/fmm/ts_terms.py | jlmaurer/tectosaur | 7cc5606d814f061395b19754e7a4b6c5e4c236e5 | [
"MIT"
] | 8 | 2019-06-10T22:19:40.000Z | 2022-01-12T20:55:37.000Z | from math import factorial
import scipy.special
import numpy as np
def sloppy_spherical(y):
r = np.linalg.norm(y)
costheta = y[2] / r
theta = np.arccos(costheta)
phi = np.arccos(y[0] / r / np.sin(theta))
return r, theta, phi
def Rdirect(n_max, y):
r, theta, phi = sloppy_spherical(y)
real =... | 34.431818 | 103 | 0.394719 | from math import factorial
import scipy.special
import numpy as np
def sloppy_spherical(y):
r = np.linalg.norm(y)
costheta = y[2] / r
theta = np.arccos(costheta)
phi = np.arccos(y[0] / r / np.sin(theta))
return r, theta, phi
def Rdirect(n_max, y):
r, theta, phi = sloppy_spherical(y)
real =... | true | true |
f72a71fdb4445df86e6a963308c53723cb7372ed | 43 | py | Python | src/util/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | src/util/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | src/util/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | # import pandas as pd
# import numpy as np
| 14.333333 | 21 | 0.72093 | true | true | |
f72a72d605a3a44af713856c6084a9b2d5e7bef2 | 6,046 | py | Python | src/attacks/base.py | DwaraknathT/sparsity | 705f2cba074e6ab4f7655c6af98882773cd826bf | [
"MIT"
] | null | null | null | src/attacks/base.py | DwaraknathT/sparsity | 705f2cba074e6ab4f7655c6af98882773cd826bf | [
"MIT"
] | null | null | null | src/attacks/base.py | DwaraknathT/sparsity | 705f2cba074e6ab4f7655c6af98882773cd826bf | [
"MIT"
] | null | null | null | import torch
class Attack(object):
r"""
Base class for all attacks.
.. note::
It automatically set device to the device where given model is.
It temporarily changes the original model's training mode to `test`
by `.eval()` only during an attack process.
"""
def __init__(s... | 28.654028 | 87 | 0.531757 | import torch
class Attack(object):
def __init__(self, name, model):
self.attack = name
self.model = model
self.model_name = str(model).split("(")[0]
self.training = model.training
self.device = next(model.parameters()).device
self._targeted = 1
self._att... | true | true |
f72a72f956c5cffe74f5d5fac3101a4868adb5bf | 28,213 | py | Python | src/test/isolation2/sql_isolation_testcase.py | fanfuxiaoran/gpdb | 84e73a9eb2d4a7aff8ab66c0ee76e47b51676be6 | [
"PostgreSQL",
"Apache-2.0"
] | 4 | 2017-11-28T08:12:58.000Z | 2020-10-28T04:15:52.000Z | src/test/isolation2/sql_isolation_testcase.py | fanfuxiaoran/gpdb | 84e73a9eb2d4a7aff8ab66c0ee76e47b51676be6 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/isolation2/sql_isolation_testcase.py | fanfuxiaoran/gpdb | 84e73a9eb2d4a7aff8ab66c0ee76e47b51676be6 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2004-Present VMware, Inc. or its affiliates.
This program and the accompanying materials are made available under
the terms of the 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://ww... | 41.007267 | 193 | 0.543296 |
import pg
import os
import subprocess
import re
import multiprocessing
import tempfile
import time
import sys
import socket
from optparse import OptionParser
import traceback
def is_digit(n):
try:
int(n)
return True
except ValueError:
return False
def null_notice_receiver(notice):
... | true | true |
f72a7465c1ba7ec4989c9a8c22e6229787aa0733 | 18,818 | py | Python | log_complete/model_89.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_89.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_89.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.349515 | 710 | 0.806515 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f72a758a140f6a7e6dd8dfc6108d52fdad330f2c | 76,634 | py | Python | hp4controller/compilers/p4_hp4.py | MNCHr/Hyper4-Controller | 3da4956d29af805d933937e545cbb33fecc4c082 | [
"MIT"
] | null | null | null | hp4controller/compilers/p4_hp4.py | MNCHr/Hyper4-Controller | 3da4956d29af805d933937e545cbb33fecc4c082 | [
"MIT"
] | null | null | null | hp4controller/compilers/p4_hp4.py | MNCHr/Hyper4-Controller | 3da4956d29af805d933937e545cbb33fecc4c082 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from p4_hlir.main import HLIR
from p4_hlir.hlir.p4_parser import p4_parse_state
import p4_hlir
from p4_hlir.hlir.p4_tables import p4_table
from compiler import HP4Compiler, CodeRepresentation
import argparse
import itertools
import code
from inspect import currentframe, getframeinfo
import sys
import... | 37.437225 | 107 | 0.599969 |
from p4_hlir.main import HLIR
from p4_hlir.hlir.p4_parser import p4_parse_state
import p4_hlir
from p4_hlir.hlir.p4_tables import p4_table
from compiler import HP4Compiler, CodeRepresentation
import argparse
import itertools
import code
from inspect import currentframe, getframeinfo
import sys
import math
from math i... | false | true |
f72a759aa3a375cf215b4b215a8f91d36710c4d8 | 316 | py | Python | checkv/__init__.py | wolfQK/CheckV-fork | 3519bf4bf07fb73806225946a5629ddc542b4252 | [
"BSD-3-Clause-LBNL"
] | null | null | null | checkv/__init__.py | wolfQK/CheckV-fork | 3519bf4bf07fb73806225946a5629ddc542b4252 | [
"BSD-3-Clause-LBNL"
] | null | null | null | checkv/__init__.py | wolfQK/CheckV-fork | 3519bf4bf07fb73806225946a5629ddc542b4252 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from checkv.modules import (
download_database,
update_database,
contamination,
completeness,
complete_genomes,
quality_summary,
end_to_end,
)
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata
__version__ = metadata.version("checkv")
| 18.588235 | 41 | 0.740506 | from checkv.modules import (
download_database,
update_database,
contamination,
completeness,
complete_genomes,
quality_summary,
end_to_end,
)
try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata
__version__ = metadata.version("checkv")
| true | true |
f72a75e5797e4be5ac376e8272c48fbbb2970c1a | 126 | py | Python | incomevis/utils/__init__.py | hieumtran/incomevis | 90adca62803f767d7c96fc879e662d934dcf9123 | [
"MIT"
] | null | null | null | incomevis/utils/__init__.py | hieumtran/incomevis | 90adca62803f767d7c96fc879e662d934dcf9123 | [
"MIT"
] | null | null | null | incomevis/utils/__init__.py | hieumtran/incomevis | 90adca62803f767d7c96fc879e662d934dcf9123 | [
"MIT"
] | null | null | null | from .getColor import *
from .getDecile import *
from .getPercentile import *
from .getStateName import *
from .path import *
| 21 | 28 | 0.761905 | from .getColor import *
from .getDecile import *
from .getPercentile import *
from .getStateName import *
from .path import *
| true | true |
f72a7713a14d8330970b9d00cd1d55249c858748 | 2,944 | py | Python | defusekit/mods/complicatedwires.py | Floozutter/defuse-kit | ef43450f93f71df6a563783da93fdefd45e0c82b | [
"Unlicense"
] | 1 | 2020-01-15T03:57:25.000Z | 2020-01-15T03:57:25.000Z | defusekit/mods/complicatedwires.py | Floozutter/defuse-kit | ef43450f93f71df6a563783da93fdefd45e0c82b | [
"Unlicense"
] | 3 | 2019-11-26T00:23:21.000Z | 2019-11-29T19:07:56.000Z | defusekit/mods/complicatedwires.py | Floozutter/defuse-kit | ef43450f93f71df6a563783da93fdefd45e0c82b | [
"Unlicense"
] | null | null | null | NAME = "complicated-wires"
import curses
from defusekit import wards
from defusekit.kittypes import Window
def get_instruction(red: bool, blue: bool, star: bool, led: bool) -> str:
binstr = "".join(["1" if b else "0" for b in (red, blue, star, led)])
wirestate = int(binstr, 2)
C = "Cut the wire"
D =... | 29.737374 | 73 | 0.53159 | NAME = "complicated-wires"
import curses
from defusekit import wards
from defusekit.kittypes import Window
def get_instruction(red: bool, blue: bool, star: bool, led: bool) -> str:
binstr = "".join(["1" if b else "0" for b in (red, blue, star, led)])
wirestate = int(binstr, 2)
C = "Cut the wire"
D =... | true | true |
f72a784ed40b4a7d44700220e01f993eed20a5e0 | 1,277 | py | Python | Problem 4.py | SuhelMehta9/Project-Euler | dbb06103ea702a137bce4e8644aa07d8913b8bd6 | [
"Unlicense"
] | null | null | null | Problem 4.py | SuhelMehta9/Project-Euler | dbb06103ea702a137bce4e8644aa07d8913b8bd6 | [
"Unlicense"
] | null | null | null | Problem 4.py | SuhelMehta9/Project-Euler | dbb06103ea702a137bce4e8644aa07d8913b8bd6 | [
"Unlicense"
] | null | null | null | # Problem 4: Largest palindrome product
# A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
# Find the largest palindrome made from the product of two 3-digit numbers.
num = 999 # Numbers start from 999
num2 = 999
palindrome = [] # Sto... | 55.521739 | 135 | 0.696163 |
num = 999
num2 = 999
palindrome = []
while num != 99:
while num2 != 99:
result = num*num2
orignal = result
result = str(result)
result= list(result)
result.reverse()
result = ''.join(result)
result = int(result)
if result == orignal:
... | true | true |
f72a78f9746119f4da8555bf50e0ea8d48a5abbe | 13,660 | py | Python | hiddenlayer/graph.py | pyjhzwh/hiddenlayer | 59f84299986d9aed7e0534147a87f7dd491ab08d | [
"MIT"
] | null | null | null | hiddenlayer/graph.py | pyjhzwh/hiddenlayer | 59f84299986d9aed7e0534147a87f7dd491ab08d | [
"MIT"
] | null | null | null | hiddenlayer/graph.py | pyjhzwh/hiddenlayer | 59f84299986d9aed7e0534147a87f7dd491ab08d | [
"MIT"
] | null | null | null | """
HiddenLayer
Implementation of the Graph class. A framework independent directed graph to
represent a neural network.
Written by Waleed Abdulla. Additions by Phil Ferriere.
Licensed under the MIT License
"""
from __future__ import absolute_import, division, print_function
import os
import re
from random import get... | 37.01897 | 119 | 0.553075 | from __future__ import absolute_import, division, print_function
import os
import re
from random import getrandbits
import inspect
import numpy as np
THEMES = {
"basic": {
"background_color": "#FFFFFF",
"fill_color": "#E8E8E8",
"outline_color": "#000000",
"font_color": "#000000",
... | true | true |
f72a79a9ba5f4c1690d21261e6cc829e1ab1cdfe | 17,260 | py | Python | scripts/greaseweazle/usb.py | zxrepo/keirf.Greaseweazle | a023ad364eb813856bb6632da87cde7e513d73d1 | [
"Unlicense"
] | 1 | 2022-03-05T14:50:48.000Z | 2022-03-05T14:50:48.000Z | scripts/greaseweazle/usb.py | zxrepo/keirf.Greaseweazle | a023ad364eb813856bb6632da87cde7e513d73d1 | [
"Unlicense"
] | null | null | null | scripts/greaseweazle/usb.py | zxrepo/keirf.Greaseweazle | a023ad364eb813856bb6632da87cde7e513d73d1 | [
"Unlicense"
] | null | null | null | # greaseweazle/usb.py
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
import struct
import itertools as it
from greaseweazle import version
from greaseweazle ... | 32.081784 | 79 | 0.554693 |
import struct
import itertools as it
from greaseweazle import version
from greaseweazle import error
from greaseweazle.flux import Flux
arComms = 10000
Normal = 9600
GetInfo = 0
Update = 1
Seek = 2
Side = 3
SetParams = 4
... | true | true |
f72a79d3d2c56e71938e0ba2cdbc1fa44b6c0c29 | 3,576 | py | Python | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/performance.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 46 | 2017-05-15T11:15:08.000Z | 2018-07-02T03:32:52.000Z | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/performance.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | null | null | null | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/lib/ops/cmd/performance.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 24 | 2017-05-17T03:26:17.000Z | 2018-07-09T07:00:50.000Z |
import ops.cmd
import util.ip
DATA_TYPES = ['all', 'browser', 'cache', 'expensive', 'icmp', 'ip', 'jobobject', 'jobobjectdetails', 'logicaldisk', 'memory', 'networkinterface', 'objects', 'pagingfile', 'physicaldisk', 'process', 'processor', 'system', 'tcp', 'telephony', 'terminalservices', 'thread', 'udp']
class... | 44.148148 | 278 | 0.635906 |
import ops.cmd
import util.ip
DATA_TYPES = ['all', 'browser', 'cache', 'expensive', 'icmp', 'ip', 'jobobject', 'jobobjectdetails', 'logicaldisk', 'memory', 'networkinterface', 'objects', 'pagingfile', 'physicaldisk', 'process', 'processor', 'system', 'tcp', 'telephony', 'terminalservices', 'thread', 'udp']
class... | true | true |
f72a79de3ba6052a6dc1da390b52adbd516b2242 | 19,851 | py | Python | train/t2m2/run.py | SungbinChoi/traffic4cast2021 | 3d63b7e90ad0d9c7346f2a6c6c89d605849bf49e | [
"Apache-2.0"
] | null | null | null | train/t2m2/run.py | SungbinChoi/traffic4cast2021 | 3d63b7e90ad0d9c7346f2a6c6c89d605849bf49e | [
"Apache-2.0"
] | null | null | null | train/t2m2/run.py | SungbinChoi/traffic4cast2021 | 3d63b7e90ad0d9c7346f2a6c6c89d605849bf49e | [
"Apache-2.0"
] | null | null | null | import random
from random import shuffle
import numpy as np
from datetime import datetime
import time
import queue
import threading
import logging
from PIL import Image
import itertools
import re
import os
import glob
import shutil
import sys
import copy
import h5py
from typing import Any, List, Tuple
import torch
impo... | 37.596591 | 137 | 0.622236 | import random
from random import shuffle
import numpy as np
from datetime import datetime
import time
import queue
import threading
import logging
from PIL import Image
import itertools
import re
import os
import glob
import shutil
import sys
import copy
import h5py
from typing import Any, List, Tuple
import torch
impo... | true | true |
f72a7bae230cca8397b711afd302b87ab9ee0214 | 995 | py | Python | techminer2/co_citation_network_degree_plot.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/co_citation_network_degree_plot.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | techminer2/co_citation_network_degree_plot.py | jdvelasq/techminer-api | d2bb7d20c326f2fe7cc06d7005dfb3f2053ea1da | [
"MIT"
] | null | null | null | """
Co-citation Network / Degree Plot
===============================================================================
>>> from techminer2 import *
>>> directory = "/workspaces/techminer2/data/"
>>> file_name = "/workspaces/techminer2/sphinx/images/co_citation_network_degree_plot.png"
>>> co_citation_network_degree_pl... | 22.613636 | 90 | 0.650251 |
from .co_citation_matrix import co_citation_matrix
from .network import network
from .network_degree_plot import network_degree_plot
def co_citation_network_degree_plot(
top_n=50,
clustering_method="louvain",
figsize=(8, 8),
directory="./",
):
matrix = co_citation_matrix(
top_n=top_n,
... | true | true |
f72a7ebb2f409e0799fadb3a1f5eb1b4ad602fb0 | 7,089 | py | Python | huaweicloud-sdk-drs/huaweicloudsdkdrs/v3/model/query_compare_result_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-drs/huaweicloudsdkdrs/v3/model/query_compare_result_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-drs/huaweicloudsdkdrs/v3/model/query_compare_result_req.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class QueryCompareResultReq:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The ... | 28.700405 | 147 | 0.616871 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class QueryCompareResultReq:
sensitive_list = []
openapi_types = {
'job_id': 'str',
'object_level_compare_id': 'str',
'line_compare_id': 'str',
'content_compare_id': 'str',
... | true | true |
f72a7fa08a350d2bd0ecab68ced86f7e2f4dcc7d | 1,205 | py | Python | ch05/solar_ce/polysol.py | jabrena/space-math | 313d66f48ef642d7ce4d2c9765d55bc4bdade17b | [
"Apache-2.0"
] | 1 | 2021-07-26T18:40:15.000Z | 2021-07-26T18:40:15.000Z | ch05/solar_ce/polysol.py | jabrena/space-math | 313d66f48ef642d7ce4d2c9765d55bc4bdade17b | [
"Apache-2.0"
] | 24 | 2021-07-10T15:31:05.000Z | 2022-03-17T06:43:36.000Z | ch05/solar_ce/polysol.py | jabrena/space-math | 313d66f48ef642d7ce4d2c9765d55bc4bdade17b | [
"Apache-2.0"
] | null | null | null | #cas
def get_infos():
import ti_graphics, ti_system
fnop = lambda : None
screen_w, screen_h, screen_y0, font_w, font_h, poly_set_pixel, poly_fill_rect, poly_draw_ellipse, poly_fill_circle, poly_get_key, poly_draw_string = 320, 210, 30, 10, 15, fnop, fnop, fnop, fnop, ti_system.wait_key, fnop
def poly_fill_... | 41.551724 | 222 | 0.66556 |
def get_infos():
import ti_graphics, ti_system
fnop = lambda : None
screen_w, screen_h, screen_y0, font_w, font_h, poly_set_pixel, poly_fill_rect, poly_draw_ellipse, poly_fill_circle, poly_get_key, poly_draw_string = 320, 210, 30, 10, 15, fnop, fnop, fnop, fnop, ti_system.wait_key, fnop
def poly_fill_rect(... | true | true |
f72a7fd3a97aca945537b27072920ef5265cb56e | 6,666 | py | Python | QUBEKit/GUI/gui.py | cole-group/QUBEK | 50f8a9c06396f2222a6fe058bf764a6bd7021e38 | [
"MIT"
] | 14 | 2018-10-19T12:32:39.000Z | 2022-01-07T05:06:06.000Z | QUBEKit/GUI/gui.py | cole-group/QUBEK | 50f8a9c06396f2222a6fe058bf764a6bd7021e38 | [
"MIT"
] | null | null | null | QUBEKit/GUI/gui.py | cole-group/QUBEK | 50f8a9c06396f2222a6fe058bf764a6bd7021e38 | [
"MIT"
] | 6 | 2019-02-26T13:32:58.000Z | 2021-06-01T15:11:27.000Z | from QUBEKit.ligand import Ligand
import os
import sys
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineView
import qdarkstyle
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, molecule=None, parent=None):
super(Ma... | 34.360825 | 118 | 0.659466 | from QUBEKit.ligand import Ligand
import os
import sys
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEnginePage, QWebEngineView
import qdarkstyle
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, molecule=None, parent=None):
super(Ma... | true | true |
f72a8051d6d4870f84f6443fa5863030117e9922 | 12,663 | py | Python | rmrb/rmrb_play_ctrl/core/dns/renderer.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_play_ctrl/core/dns/renderer.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | rmrb/rmrb_play_ctrl/core/dns/renderer.py | fjfhccfkuk/h_s_x_r_m_r_b_python | 46fe249b1b71f1245296c8b2dbd6e7c29dadade4 | [
"Unlicense"
] | null | null | null | # Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | 38.372727 | 107 | 0.60657 |
from io import BytesIO
import struct
import random
import time
import rmrb_play_ctrl.core.dns.exception
import rmrb_play_ctrl.core.dns.tsig
from ._compat import long
QUESTION = 0
ANSWER = 1
AUTHORITY = 2
ADDITIONAL = 3
class Renderer(object):
def __init__(self, id=None, flags=0, max_size=6553... | true | true |
f72a80ec4e6d319a9bd40ffec2bbee1e64fbb6c7 | 16,207 | py | Python | espei/datasets.py | jwsiegel2510/ESPEI | cb72f676138c96d560d8b83cea6b7ca2da100078 | [
"MIT"
] | null | null | null | espei/datasets.py | jwsiegel2510/ESPEI | cb72f676138c96d560d8b83cea6b7ca2da100078 | [
"MIT"
] | null | null | null | espei/datasets.py | jwsiegel2510/ESPEI | cb72f676138c96d560d8b83cea6b7ca2da100078 | [
"MIT"
] | null | null | null | import fnmatch, warnings, json, os
import numpy as np
from six import string_types
from tinydb.storages import MemoryStorage
from tinydb import where
from espei.utils import PickleableTinyDB
from espei.core_utils import recursive_map
class DatasetError(Exception):
"""Exception raised when datasets are invalid.""... | 45.144847 | 244 | 0.649596 | import fnmatch, warnings, json, os
import numpy as np
from six import string_types
from tinydb.storages import MemoryStorage
from tinydb import where
from espei.utils import PickleableTinyDB
from espei.core_utils import recursive_map
class DatasetError(Exception):
pass
def check_dataset(dataset):
is_activi... | true | true |
f72a8175c066c50bcc168821cbcb8091f9cd439a | 6,618 | py | Python | Collections-a-installer/community-general-2.4.0/plugins/modules/ipa_service.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/ipa_service.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 1 | 2022-03-12T02:25:26.000Z | 2022-03-12T02:25:26.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/ipa_service.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: ipa_service
author: Cédri... | 31.665072 | 110 | 0.636144 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: ipa_service
author: Cédric Parent (@cprh)
short_description: Manage FreeIPA service
description:
- Add and delete an IPA service using IPA API.
options:
krbcanonicalname:
description:
-... | true | true |
f72a82afacbfe8c4a9d386c3c67b25d21ca8d4cb | 3,193 | py | Python | var/spack/repos/builtin/packages/meson/package.py | jjellio/spack | 1fa16c1b9b08119be429821fbd2f3251458d5063 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-12-28T14:38:41.000Z | 2020-12-28T14:38:41.000Z | var/spack/repos/builtin/packages/meson/package.py | jjellio/spack | 1fa16c1b9b08119be429821fbd2f3251458d5063 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-02-15T01:32:22.000Z | 2022-03-31T06:06:05.000Z | var/spack/repos/builtin/packages/meson/package.py | karcaw/spack | 2b3ca6c3e39f486c9cf277f2ca8fef12d54300c2 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Meson(PythonPackage):
"""Meson is a portable open source build system meant to be both
... | 53.216667 | 96 | 0.757282 |
from spack import *
class Meson(PythonPackage):
homepage = "http://mesonbuild.com/"
url = "https://github.com/mesonbuild/meson/archive/0.49.0.tar.gz"
maintainers = ['michaelkuhn']
version('0.57.1', sha256='0c043c9b5350e9087cd4f6becf6c0d10b1d618ca3f919e0dcca2cdf342360d5d')
version('0.... | true | true |
f72a82e3656b23a98910f3bc1d1712b42ddd274d | 30,279 | py | Python | neutron/plugins/openvswitch/ovs_neutron_plugin.py | ksshanam/neutron-vrrp | f9fb7f9b41adc0de401cc118a4d97026d3abb6e0 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/openvswitch/ovs_neutron_plugin.py | ksshanam/neutron-vrrp | f9fb7f9b41adc0de401cc118a4d97026d3abb6e0 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/openvswitch/ovs_neutron_plugin.py | ksshanam/neutron-vrrp | f9fb7f9b41adc0de401cc118a4d97026d3abb6e0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 46.726852 | 79 | 0.597114 |
import sys
from oslo.config import cfg
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import dhcp_rpc
from neutron.api.rpc.handlers import l3_r... | true | true |
f72a83c49b78622f2d47b7d505eed6ddffe2fe8d | 6,547 | py | Python | monero_glue/xmr/sub/mlsag_hasher.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 20 | 2018-04-05T22:06:10.000Z | 2021-09-18T10:43:44.000Z | monero_glue/xmr/sub/mlsag_hasher.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | null | null | null | monero_glue/xmr/sub/mlsag_hasher.py | ph4r05/monero-agent | 0bac0e6f33142b2bb885565bfd1ef8ac04559280 | [
"MIT"
] | 5 | 2018-08-06T15:06:04.000Z | 2021-07-16T01:58:43.000Z | from monero_glue.xmr import crypto
from monero_glue.xmr.sub.keccak_hasher import HashWrapper
from monero_serialize import xmrserialize
class PreMlsagHasher(object):
"""
Iterative construction of the pre_mlsag_hash
"""
def __init__(self, state=None):
from monero_glue.xmr.sub.keccak_hasher impo... | 30.882075 | 86 | 0.590805 | from monero_glue.xmr import crypto
from monero_glue.xmr.sub.keccak_hasher import HashWrapper
from monero_serialize import xmrserialize
class PreMlsagHasher(object):
def __init__(self, state=None):
from monero_glue.xmr.sub.keccak_hasher import HashWrapper, KeccakXmrArchive
self.is_simple = state[... | true | true |
f72a84f3844befc8aa1a322a61d1a30d58921cb7 | 5,638 | py | Python | apps/challenges/tests/test_challenges.py | gene1wood/spark | 071d6da19076ee047530220223d7beab3d31abab | [
"BSD-3-Clause"
] | 3 | 2015-12-09T15:02:03.000Z | 2017-10-05T16:54:14.000Z | apps/challenges/tests/test_challenges.py | gene1wood/spark | 071d6da19076ee047530220223d7beab3d31abab | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:29:25.000Z | 2019-03-28T03:40:58.000Z | apps/challenges/tests/test_challenges.py | gene1wood/spark | 071d6da19076ee047530220223d7beab3d31abab | [
"BSD-3-Clause"
] | 3 | 2019-03-28T03:41:01.000Z | 2020-04-29T09:47:21.000Z | import logging
from datetime import datetime, timedelta
from spark.tests import TestCase
from nose.tools import eq_
from geo.continents import (AFRICA, ASIA, EUROPE, NORTH_AMERICA, SOUTH_AMERICA,
OCEANIA, ANTARCTICA)
from users.models import User
from stats.models import SharingHistory
f... | 27.773399 | 79 | 0.631075 | import logging
from datetime import datetime, timedelta
from spark.tests import TestCase
from nose.tools import eq_
from geo.continents import (AFRICA, ASIA, EUROPE, NORTH_AMERICA, SOUTH_AMERICA,
OCEANIA, ANTARCTICA)
from users.models import User
from stats.models import SharingHistory
f... | true | true |
f72a8508eb15e1b3e71b5ca8ef252bc825472afa | 15,226 | py | Python | tests/integration-tests/tests/storage/test_ebs.py | eshpc/aws-parallelcluster | 8cc6169a12661ce1c0025c93ebd9019c26e7219e | [
"Apache-2.0"
] | null | null | null | tests/integration-tests/tests/storage/test_ebs.py | eshpc/aws-parallelcluster | 8cc6169a12661ce1c0025c93ebd9019c26e7219e | [
"Apache-2.0"
] | 108 | 2021-10-11T09:12:06.000Z | 2022-03-28T09:28:39.000Z | tests/integration-tests/tests/storage/test_ebs.py | yuleiwan/aws-parallelcluster | aad2a3019ef4ad08d702f5acf41b152b3f7a0b46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file acc... | 46.705521 | 120 | 0.732825 |
import logging
import boto3
import pytest
import utils
from assertpy import assert_that
from remote_command_executor import RemoteCommandExecutor
from tests.common.schedulers_common import get_scheduler_commands
from tests.storage.kms_key_factory import KMSKeyFactory
from tests.storage.snapshots_factory im... | true | true |
f72a864d02a1615e377a438d9b2868959da2187a | 8,179 | py | Python | tensorflow_text/python/ops/bert_tokenizer.py | kornesh/text | f762def9dbb14f8f182936dd25af154af79f366e | [
"Apache-2.0"
] | null | null | null | tensorflow_text/python/ops/bert_tokenizer.py | kornesh/text | f762def9dbb14f8f182936dd25af154af79f366e | [
"Apache-2.0"
] | null | null | null | tensorflow_text/python/ops/bert_tokenizer.py | kornesh/text | f762def9dbb14f8f182936dd25af154af79f366e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 TF.Text Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 40.093137 | 80 | 0.711334 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import lookup_ops
from tensorflow.python.ops import string_ops
f... | true | true |
f72a86580356f7077caa16bc6708c93567dae160 | 6,746 | py | Python | py_algorithms/data_structures/heap.py | rlishtaba/py-algorithms-playground | ce7cf332483e01d05bcad98921d736c33a33a66c | [
"MIT"
] | 31 | 2017-09-17T06:29:15.000Z | 2022-03-11T14:45:40.000Z | py_algorithms/data_structures/heap.py | MindaugasVaitkus2/py-algorithms | ce7cf332483e01d05bcad98921d736c33a33a66c | [
"MIT"
] | null | null | null | py_algorithms/data_structures/heap.py | MindaugasVaitkus2/py-algorithms | ce7cf332483e01d05bcad98921d736c33a33a66c | [
"MIT"
] | 11 | 2017-11-01T20:33:20.000Z | 2022-02-13T16:54:21.000Z | import sys
from typing import Any
from typing import Callable
from typing import List
from typing import Union
from ..utils import test_iterable
class _HeapNode:
def __init__(self, key: Any, value: Any):
self.key = key
self.value = value
self.degree = 0
self.marked = False
... | 29.982222 | 88 | 0.546991 | import sys
from typing import Any
from typing import Callable
from typing import List
from typing import Union
from ..utils import test_iterable
class _HeapNode:
def __init__(self, key: Any, value: Any):
self.key = key
self.value = value
self.degree = 0
self.marked = False
... | true | true |
f72a870c46c2c96ce5f26f8f2ab22a280b9f3442 | 9,272 | py | Python | test-features.py | MartyLake/KLTypeList | 76529f9b494b4474e334958544de99253f878b6c | [
"MIT"
] | null | null | null | test-features.py | MartyLake/KLTypeList | 76529f9b494b4474e334958544de99253f878b6c | [
"MIT"
] | null | null | null | test-features.py | MartyLake/KLTypeList | 76529f9b494b4474e334958544de99253f878b6c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Alain Martin
import argparse
import ast
import os
import re
import subprocess
import sys
import tempfile
FEATURE_EXT = '.feature'
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
def compiler_arg_choices():
compilers_dir = os.path.join(REPO_ROOT, 'compilers')
... | 30.006472 | 77 | 0.574418 |
import argparse
import ast
import os
import re
import subprocess
import sys
import tempfile
FEATURE_EXT = '.feature'
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
def compiler_arg_choices():
compilers_dir = os.path.join(REPO_ROOT, 'compilers')
return [os.path.basename(file_name)
f... | false | true |
f72a885aba97b22f715ae7119075a6a258e3e0a9 | 3,885 | py | Python | func.py | Abner0627/IPRV_Optical-Flow | 85c0650f671ad44c8bbe1d820a761be42cbe56d0 | [
"MIT"
] | null | null | null | func.py | Abner0627/IPRV_Optical-Flow | 85c0650f671ad44c8bbe1d820a761be42cbe56d0 | [
"MIT"
] | null | null | null | func.py | Abner0627/IPRV_Optical-Flow | 85c0650f671ad44c8bbe1d820a761be42cbe56d0 | [
"MIT"
] | null | null | null | import cv2
import os
import numpy as np
import matplotlib.pyplot as plt
# %%
def _pick(L, ty, path):
L_ = [cv2.imread(os.path.join(path, i)) for i in L if i.split('_')[0]==ty]
# 輸入影像
return L_
def _gray(img):
return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
def _Pos(img, idx):
def on_press(event):
... | 32.107438 | 122 | 0.488288 | import cv2
import os
import numpy as np
import matplotlib.pyplot as plt
def _pick(L, ty, path):
L_ = [cv2.imread(os.path.join(path, i)) for i in L if i.split('_')[0]==ty]
return L_
def _gray(img):
return cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
def _Pos(img, idx):
def on_press(event):
L.ap... | true | true |
f72a8a9e767b0990ec36270d87dafab2e37e3e27 | 276,837 | py | Python | mindspore/ops/operations/nn_ops.py | Rossil2012/mindspore | 8a20b5d784b3fec6d32e058581ec56ec553a06a0 | [
"Apache-2.0"
] | 1 | 2021-04-23T06:35:18.000Z | 2021-04-23T06:35:18.000Z | mindspore/ops/operations/nn_ops.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | mindspore/ops/operations/nn_ops.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.807652 | 120 | 0.628525 |
import math
import operator
from functools import reduce
import numpy as np
from ... import context
from .. import signature as sig
from ..._checkparam import Validator as validator
from ..._checkparam import Rel
from ...common import dtype as mstype
from ..primitive import Primitive, PrimitiveWithInf... | true | true |
f72a8af8ff8184287d32ace234a39d44ce65d605 | 25,935 | py | Python | lib/kb_das_tool/Utils/DASToolUtil.py | n1mus/kb_das_tool | e19f2c68aa24a93eec95a2dcbb6d662d7c088dcc | [
"MIT"
] | null | null | null | lib/kb_das_tool/Utils/DASToolUtil.py | n1mus/kb_das_tool | e19f2c68aa24a93eec95a2dcbb6d662d7c088dcc | [
"MIT"
] | null | null | null | lib/kb_das_tool/Utils/DASToolUtil.py | n1mus/kb_das_tool | e19f2c68aa24a93eec95a2dcbb6d662d7c088dcc | [
"MIT"
] | null | null | null | import errno
import json
import os
import subprocess
import sys
import time
import uuid
import zipfile
import shutil
from Bio import SeqIO
from installed_clients.AssemblyUtilClient import AssemblyUtil
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseRe... | 44.409247 | 154 | 0.609794 | import errno
import json
import os
import subprocess
import sys
import time
import uuid
import zipfile
import shutil
from Bio import SeqIO
from installed_clients.AssemblyUtilClient import AssemblyUtil
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.KBaseReportClient import KBaseRe... | true | true |
f72a8b1d41dcd8162bc15ea1ac9f0f974c941910 | 801 | py | Python | venv/Scripts/f2py.py | nfuster2017/AmazonWebCrawler | d45e2dec826b5cadd632ed8a94c2c4c127430000 | [
"MIT"
] | 1 | 2019-07-28T05:32:10.000Z | 2019-07-28T05:32:10.000Z | venv/Scripts/f2py.py | nfuster2017/AmazonWebCrawler | d45e2dec826b5cadd632ed8a94c2c4c127430000 | [
"MIT"
] | 4 | 2021-06-08T20:08:26.000Z | 2022-03-11T23:54:16.000Z | venv/Scripts/f2py.py | nfuster2017/AmazonWebCrawler | d45e2dec826b5cadd632ed8a94c2c4c127430000 | [
"MIT"
] | null | null | null | #!D:\School\UMD\INST326\Group Project\venv\Scripts\python.exe
# See http://cens.ioc.ee/projects/f2py2e/
from __future__ import division, print_function
import os
import sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
try:
i = sys.argv.index("--" + mode)
del sys.argv[i]
... | 27.62069 | 67 | 0.645443 |
from __future__ import division, print_function
import os
import sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
try:
i = sys.argv.index("--" + mode)
del sys.argv[i]
break
except ValueError:
pass
os.environ["NO_SCIPY_IMPORT"] = "f2py"
if mode == "g3-nump... | true | true |
f72a8d3c2c03ab88dbb2873eded7eee4dbec4655 | 1,951 | py | Python | testing/exercise/vehicle/test/test_vehicle.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | 1 | 2021-05-27T07:59:17.000Z | 2021-05-27T07:59:17.000Z | testing/exercise/vehicle/test/test_vehicle.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | null | null | null | testing/exercise/vehicle/test/test_vehicle.py | PetkoAndreev/Python-OOP | 2cc3094940cdf078f0ee60be938e883f843766e4 | [
"MIT"
] | null | null | null | import unittest
from python_oop.testing.exercise.vehicle.project.vehicle import Vehicle
# from project.vehicle import Vehicle
class VehicleTest(unittest.TestCase):
def setUp(self):
self.vehicle = Vehicle(50.0, 300.0)
def test_vehicle__init_method(self):
self.assertEqual(50.0, self.vehicle.fu... | 36.811321 | 128 | 0.708355 | import unittest
from python_oop.testing.exercise.vehicle.project.vehicle import Vehicle
class VehicleTest(unittest.TestCase):
def setUp(self):
self.vehicle = Vehicle(50.0, 300.0)
def test_vehicle__init_method(self):
self.assertEqual(50.0, self.vehicle.fuel)
self.assertEqual(50.0, se... | true | true |
f72a8f6331ddd325a61a09e43d5a54e5309a6648 | 1,760 | py | Python | examples/ad_manager/v201911/user_service/get_all_users.py | MattCardoso/googleads-python-lib | 62f0db9fdb78a1bcdb1e61c82c609d9f47cb48d8 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201911/user_service/get_all_users.py | MattCardoso/googleads-python-lib | 62f0db9fdb78a1bcdb1e61c82c609d9f47cb48d8 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201911/user_service/get_all_users.py | MattCardoso/googleads-python-lib | 62f0db9fdb78a1bcdb1e61c82c609d9f47cb48d8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 35.2 | 78 | 0.702841 |
from googleads import ad_manager
def main(client):
user_service = client.GetService('UserService', version='v201911')
statement = ad_manager.StatementBuilder(version='v201911')
while True:
response = user_service.getUsersByStatement(statement.ToStatement())
if 'results' in... | true | true |
f72a8ffa64b566ce6eec8c0c16ba2850ac0a95f6 | 2,245 | py | Python | examples/lm1b/main.py | mjsML/fast_flax | d982b59b715524884d08d6ed506ab325e8be1ece | [
"Apache-2.0"
] | null | null | null | examples/lm1b/main.py | mjsML/fast_flax | d982b59b715524884d08d6ed506ab325e8be1ece | [
"Apache-2.0"
] | 1 | 2021-08-16T09:16:55.000Z | 2021-08-16T09:16:55.000Z | examples/lm1b/main.py | mjsML/fast_flax | d982b59b715524884d08d6ed506ab325e8be1ece | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 34.015152 | 80 | 0.728285 |
from absl import app
from absl import flags
from absl import logging
from clu import platform
import train
import jax
from ml_collections import config_flags
import tensorflow as tf
FLAGS = flags.FLAGS
flags.DEFINE_string('workdir', None, 'Directory to store model data.')
config_flags.DEFINE_config_fi... | true | true |
f72a91102600de8d03a0b64c5ee35b9767a86fd4 | 4,373 | py | Python | dash_core_components/RangeSlider.py | mako-npm/dash-core-components | 0cbc3d8093c678e59b5b4dfa3aa2637d071a5b33 | [
"MIT"
] | null | null | null | dash_core_components/RangeSlider.py | mako-npm/dash-core-components | 0cbc3d8093c678e59b5b4dfa3aa2637d071a5b33 | [
"MIT"
] | null | null | null | dash_core_components/RangeSlider.py | mako-npm/dash-core-components | 0cbc3d8093c678e59b5b4dfa3aa2637d071a5b33 | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class RangeSlider(Component):
"""A RangeSlider component.
A double slider with two handles.
Used for specifying a range of numerical values.
Keyword arguments:
- id (string; optional)
- marks (optional):... | 59.094595 | 490 | 0.732678 |
from dash.development.base_component import Component, _explicitize_args
class RangeSlider(Component):
@_explicitize_args
def __init__(self, id=Component.UNDEFINED, marks=Component.UNDEFINED, value=Component.UNDEFINED, allowCross=Component.UNDEFINED, className=Component.UNDEFINED, count=Component.UNDEFINED,... | true | true |
f72a9127d88cdefba5bdb5fb1446f97866851501 | 1,697 | py | Python | model/optimizer.py | keonlee9420/DiffSinger | 2bfcae4a78068c2061eae64ee675959a077aa54b | [
"MIT"
] | 95 | 2021-06-04T02:22:36.000Z | 2022-03-25T03:19:51.000Z | model/optimizer.py | keonlee9420/DiffSinger | 2bfcae4a78068c2061eae64ee675959a077aa54b | [
"MIT"
] | 3 | 2021-06-23T08:57:00.000Z | 2021-10-14T10:44:43.000Z | model/optimizer.py | keonlee9420/DiffSinger | 2bfcae4a78068c2061eae64ee675959a077aa54b | [
"MIT"
] | 15 | 2021-06-04T03:09:12.000Z | 2022-03-30T08:23:05.000Z | import torch
import numpy as np
class ScheduledOptim:
""" A simple wrapper class for learning rate scheduling """
def __init__(self, model, train_config, model_config, current_step):
self._optimizer = torch.optim.Adam(
model.parameters(),
betas=train_config["optimi... | 32.634615 | 73 | 0.592222 | import torch
import numpy as np
class ScheduledOptim:
def __init__(self, model, train_config, model_config, current_step):
self._optimizer = torch.optim.Adam(
model.parameters(),
betas=train_config["optimizer"]["betas"],
eps=train_config["optimizer"]["eps"]... | true | true |
f72a913c6611cb848d4d5714cbbb1562b72dda22 | 14,624 | py | Python | billforward/models/resume_subscription_amendment.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | 2 | 2016-11-23T17:32:37.000Z | 2022-02-24T05:13:20.000Z | billforward/models/resume_subscription_amendment.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | null | null | null | billforward/models/resume_subscription_amendment.py | billforward/bf-python | d2b812329ca3ed1fd94364d7f46f69ad74665596 | [
"Apache-2.0"
] | 1 | 2016-12-30T20:02:48.000Z | 2016-12-30T20:02:48.000Z | # coding: utf-8
"""
BillForward REST API
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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... | 34.088578 | 477 | 0.601409 |
from pprint import pformat
from six import iteritems
import re
class ResumeSubscriptionAmendment(object):
def __init__(self, created=None, changed_by=None, updated=None, type=None, id=None, organization_id=None, subscription_id=None, amendment_type=None, actioning_time=None, actioned_time=None, state=None, del... | true | true |
f72a91979056173940df72257c9632371d082496 | 7,763 | py | Python | zun/objects/container_action.py | hualingson/zun | 4fc4e9e0e0f5478d749215c7ba0679a8502f7737 | [
"Apache-2.0"
] | null | null | null | zun/objects/container_action.py | hualingson/zun | 4fc4e9e0e0f5478d749215c7ba0679a8502f7737 | [
"Apache-2.0"
] | null | null | null | zun/objects/container_action.py | hualingson/zun | 4fc4e9e0e0f5478d749215c7ba0679a8502f7737 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 40.643979 | 79 | 0.637382 |
import traceback
from oslo_log import log as logging
from oslo_utils import timeutils
from oslo_versionedobjects import fields
import six
from zun.db import api as dbapi
from zun.objects import base
LOG = logging.getLogger(__name__)
@base.ZunObjectRegistry.register
class ContainerAction(base.ZunPersist... | true | true |
f72a92773a71cfadb3c6851d87b7e65eff09358d | 6,096 | py | Python | BaseExtension.py | heyzec/Inkscape-Extentions | dedfc5e6d567218a397d48133c4cb5a62cd5b09b | [
"MIT"
] | 5 | 2021-07-04T10:28:49.000Z | 2022-02-22T16:48:04.000Z | BaseExtension.py | heyzec/Inkscape-Extentions | dedfc5e6d567218a397d48133c4cb5a62cd5b09b | [
"MIT"
] | null | null | null | BaseExtension.py | heyzec/Inkscape-Extentions | dedfc5e6d567218a397d48133c4cb5a62cd5b09b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# pylint: disable=too-many-ancestors
# standard library
import os
import sys
import re
import argparse
from shutil import copy2
# from subprocess import Popen, PIPE
# import time
# from lxml import etree
# local library
import inkex
from inkex.command import inkscape
from inkex.elements import... | 32.425532 | 103 | 0.58563 |
import os
import sys
import re
import argparse
from shutil import copy2
import inkex
from inkex.command import inkscape
from inkex.elements import _selected as selection
MIN_PYTHON_VERSION = (3, 6)
if (sys.version_info.major, sys.version_info.minor) < (3, 6):
inkex.Effect.msg(f"Python {MIN_PYTHON_VERSI... | true | true |
f72a938f9b1d2ca33b06ff8d32d27e738b47788b | 1,775 | py | Python | whales/architectures/new_gsc3_for_512.py | CKhan1/READ-PSB-AI-right-whale-photo-id-Kaggle | b6723724148029f68187bbd7ac598ea90a7542f3 | [
"MIT"
] | 2 | 2020-08-19T11:03:42.000Z | 2022-02-18T02:49:28.000Z | whales/architectures/new_gsc3_for_512.py | X10Khan/whales | 313fd487dec6080bb3a518d312cd9f1e29958f16 | [
"MIT"
] | null | null | null | whales/architectures/new_gsc3_for_512.py | X10Khan/whales | 313fd487dec6080bb3a518d312cd9f1e29958f16 | [
"MIT"
] | 4 | 2018-10-23T15:47:22.000Z | 2021-02-03T03:35:13.000Z | import copy
from TheanoLib.init import Normal
from TheanoLib.modules import Sequential, Flatten, Dropout, Dense, identity, Softmax, FanOut, Parallel, Subtensor, \
SimpleApply, softmax
from architecture import create_conv_colum
import theano.tensor as T
def create(image_size=(448, 448), n_outs=[447], dropout=False,... | 29.583333 | 116 | 0.618592 | import copy
from TheanoLib.init import Normal
from TheanoLib.modules import Sequential, Flatten, Dropout, Dense, identity, Softmax, FanOut, Parallel, Subtensor, \
SimpleApply, softmax
from architecture import create_conv_colum
import theano.tensor as T
def create(image_size=(448, 448), n_outs=[447], dropout=False,... | false | true |
f72a93a6ef5bdbef78fc92eeacc5548f6c09045a | 181 | py | Python | delphi_epidata/_constants.py | lee14257/delphi-epidata-py | ca84147fb75a50b073bab43e77dcb32b52b26f4b | [
"MIT"
] | null | null | null | delphi_epidata/_constants.py | lee14257/delphi-epidata-py | ca84147fb75a50b073bab43e77dcb32b52b26f4b | [
"MIT"
] | null | null | null | delphi_epidata/_constants.py | lee14257/delphi-epidata-py | ca84147fb75a50b073bab43e77dcb32b52b26f4b | [
"MIT"
] | 1 | 2021-12-22T23:56:58.000Z | 2021-12-22T23:56:58.000Z | from typing import Final
__version__: Final = "1.0.0"
HTTP_HEADERS: Final = {"User-Agent": f"delphi_epidata/{__version__}"}
BASE_URL: Final = "https://delphi.cmu.edu/epidata/"
| 18.1 | 69 | 0.712707 | from typing import Final
__version__: Final = "1.0.0"
HTTP_HEADERS: Final = {"User-Agent": f"delphi_epidata/{__version__}"}
BASE_URL: Final = "https://delphi.cmu.edu/epidata/"
| true | true |
f72a948c70be197e27db61e983500bbbb2328e4d | 1,015 | py | Python | plugins/readme/girder_readme/rest.py | JKitok/girder | 317962d155fc9811d25e5f33bd3e849c4ac96645 | [
"Apache-2.0"
] | 395 | 2015-01-12T19:20:13.000Z | 2022-03-30T05:40:40.000Z | plugins/readme/girder_readme/rest.py | JKitok/girder | 317962d155fc9811d25e5f33bd3e849c4ac96645 | [
"Apache-2.0"
] | 2,388 | 2015-01-01T20:09:19.000Z | 2022-03-29T16:49:14.000Z | plugins/readme/girder_readme/rest.py | JKitok/girder | 317962d155fc9811d25e5f33bd3e849c4ac96645 | [
"Apache-2.0"
] | 177 | 2015-01-04T14:47:00.000Z | 2022-03-25T09:01:51.000Z | # -*- coding: utf-8 -*-
import re
import cherrypy
from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.constants import AccessType, TokenScope
from girder.models.file import File as FileModel
from girder.models.folder import Folder as FolderModel
from girder.models.it... | 32.741935 | 64 | 0.693596 |
import re
import cherrypy
from girder.api import access
from girder.api.describe import Description, autoDescribeRoute
from girder.constants import AccessType, TokenScope
from girder.models.file import File as FileModel
from girder.models.folder import Folder as FolderModel
from girder.models.item import Item as ItemM... | true | true |
f72a950bc8465538bf3a53bd013a276fafc97895 | 28,988 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py | lynshi/azure-sdk-for-python | 40c530f2e9a6d93025b01cc8f6c94829c7fe95fc | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py | lynshi/azure-sdk-for-python | 40c530f2e9a6d93025b01cc8f6c94829c7fe95fc | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py | lynshi/azure-sdk-for-python | 40c530f2e9a6d93025b01cc8f6c94829c7fe95fc | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import pytest
import platform
import functools
import itertools
import datetime
from azure.core.exceptions import HttpResponseError, ClientAut... | 44.054711 | 146 | 0.630537 |
import os
import pytest
import platform
import functools
import itertools
import datetime
from azure.core.exceptions import HttpResponseError, ClientAuthenticationError
from azure.core.credentials import AzureKeyCredential
from testcase import TextAnalyticsTest, GlobalTextAnalyticsAccountPreparer
from testcase i... | true | true |
f72a95a36cb73e6369f0ae2694d3a4c317a14ec5 | 1,549 | py | Python | package/spack-py-backcall/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-py-backcall/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-py-backcall/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 44.257143 | 78 | 0.68173 | true | true | |
f72a95f93d1a01fdc3492157c0b5fc9e8d191481 | 524 | py | Python | alembic/versions/1c697a5bd34f_addeding_lessons_tau.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 13 | 2015-04-27T14:26:19.000Z | 2021-11-21T16:11:17.000Z | alembic/versions/1c697a5bd34f_addeding_lessons_tau.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 15 | 2015-04-25T22:29:50.000Z | 2016-09-01T16:59:21.000Z | alembic/versions/1c697a5bd34f_addeding_lessons_tau.py | codeforamerica/bizfriendly-api | b3f3b9f83652ec67752d629baaf0bc1d4ec67695 | [
"BSD-Source-Code"
] | 9 | 2015-06-19T19:48:40.000Z | 2021-04-16T10:27:29.000Z | """Addeding lessons taught to user
Revision ID: 1c697a5bd34f
Revises: 23aebf11a765
Create Date: 2014-01-04 13:13:39.599020
"""
# revision identifiers, used by Alembic.
revision = '1c697a5bd34f'
down_revision = '23aebf11a765'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gener... | 19.407407 | 63 | 0.694656 |
revision = '1c697a5bd34f'
down_revision = '23aebf11a765'
from alembic import op
import sqlalchemy as sa
def upgrade():
| true | true |
f72a96fc280c4b6ed142ea022c0e6662161e6044 | 378 | py | Python | tests/operator/function_test.py | MingboPeng/queenbee | a7968b0f88833cdfab928ca681057bf245f36ed2 | [
"MIT"
] | null | null | null | tests/operator/function_test.py | MingboPeng/queenbee | a7968b0f88833cdfab928ca681057bf245f36ed2 | [
"MIT"
] | null | null | null | tests/operator/function_test.py | MingboPeng/queenbee | a7968b0f88833cdfab928ca681057bf245f36ed2 | [
"MIT"
] | null | null | null | import yaml
from tests.base.io_test import BaseIOTest
from tests.base.value_error import BaseValueErrorTest
from queenbee.operator.function import Function
ASSET_FOLDER = 'tests/assets/functions'
class TestIO(BaseIOTest):
klass = Function
asset_folder = ASSET_FOLDER
class TestValueError(BaseValueErrorTest... | 18.9 | 53 | 0.793651 | import yaml
from tests.base.io_test import BaseIOTest
from tests.base.value_error import BaseValueErrorTest
from queenbee.operator.function import Function
ASSET_FOLDER = 'tests/assets/functions'
class TestIO(BaseIOTest):
klass = Function
asset_folder = ASSET_FOLDER
class TestValueError(BaseValueErrorTest... | true | true |
f72a99520193f77a04dcbe1808375927c8ee383b | 289 | py | Python | Feature/structure_tensor_eigenvalues.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Feature/structure_tensor_eigenvalues.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | Feature/structure_tensor_eigenvalues.py | Joevaen/Scikit-image_On_CT | e3bf0eeadc50691041b4b7c44a19d07546a85001 | [
"Apache-2.0"
] | null | null | null | # 计算结构张量的特征值。
from skimage.feature import structure_tensor
from skimage.feature import structure_tensor_eigenvalues
import numpy as np
square = np.zeros((5, 5))
square[2, 2] = 1
A_elems = structure_tensor(square, sigma=0.1, order='rc')
print(structure_tensor_eigenvalues(A_elems)[0])
| 20.642857 | 57 | 0.778547 |
from skimage.feature import structure_tensor
from skimage.feature import structure_tensor_eigenvalues
import numpy as np
square = np.zeros((5, 5))
square[2, 2] = 1
A_elems = structure_tensor(square, sigma=0.1, order='rc')
print(structure_tensor_eigenvalues(A_elems)[0])
| true | true |
f72a99912cc462e12e16df173b954984f4d5d9a7 | 6,184 | py | Python | nomadgram/images/views.py | wayhome25/nomadgram | 54d578e5674a0b35786d6c889b06ba019b648575 | [
"MIT"
] | null | null | null | nomadgram/images/views.py | wayhome25/nomadgram | 54d578e5674a0b35786d6c889b06ba019b648575 | [
"MIT"
] | 11 | 2020-09-05T05:23:03.000Z | 2022-03-11T23:26:18.000Z | nomadgram/images/views.py | wayhome25/nomadgram | 54d578e5674a0b35786d6c889b06ba019b648575 | [
"MIT"
] | 4 | 2017-12-22T05:53:37.000Z | 2020-04-25T03:13:47.000Z | from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from django.db.models import Q
from django.shortcuts import get_object_or_404
from nomadgram.images.models import Comment
from nomadgram.images.models import Image
from nomadgram.images.models impor... | 37.02994 | 109 | 0.687581 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from django.db.models import Q
from django.shortcuts import get_object_or_404
from nomadgram.images.models import Comment
from nomadgram.images.models import Image
from nomadgram.images.models impor... | true | true |
f72a99a11e52fd71703f1220515453c9acbbe085 | 552 | py | Python | socialnews/mptt/tests/settings.py | agiliq/django-socialnews | aa4a1a4a0e3279e6c7999071648ba37c71df9d15 | [
"BSD-3-Clause"
] | 30 | 2015-01-18T16:34:03.000Z | 2021-05-23T20:05:54.000Z | socialnews/mptt/tests/settings.py | agiliq/django-socialnews | aa4a1a4a0e3279e6c7999071648ba37c71df9d15 | [
"BSD-3-Clause"
] | null | null | null | socialnews/mptt/tests/settings.py | agiliq/django-socialnews | aa4a1a4a0e3279e6c7999071648ba37c71df9d15 | [
"BSD-3-Clause"
] | 11 | 2015-02-21T10:45:41.000Z | 2021-01-24T21:08:20.000Z | import os
DIRNAME = os.path.dirname(__file__)
DEBUG = True
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = os.path.join(DIRNAME, 'mptt.db')
#DATABASE_ENGINE = 'mysql'
#DATABASE_NAME = 'mptt_test'
#DATABASE_USER = 'root'
#DATABASE_PASSWORD = ''
#DATABASE_HOST = 'localhost'
#DATABASE_PORT = '3306'
#DATAB... | 19.714286 | 49 | 0.684783 | import os
DIRNAME = os.path.dirname(__file__)
DEBUG = True
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = os.path.join(DIRNAME, 'mptt.db')
INSTALLED_APPS = (
'mptt',
'mptt.tests',
)
| true | true |
f72a9a36d3435f37d58e7109c367b25a53d50743 | 541 | py | Python | samples/fan_in_fan_out/HttpStart/__init__.py | sebastianburckhardt/azure-functions-durable-python | 634f70887e415f0ff9e7ee1e2fb3f58f90112772 | [
"MIT"
] | 78 | 2020-03-30T19:05:23.000Z | 2022-03-30T06:55:47.000Z | samples/fan_in_fan_out/HttpStart/__init__.py | sebastianburckhardt/azure-functions-durable-python | 634f70887e415f0ff9e7ee1e2fb3f58f90112772 | [
"MIT"
] | 180 | 2020-04-01T22:25:59.000Z | 2022-03-29T14:23:16.000Z | samples/fan_in_fan_out/HttpStart/__init__.py | sebastianburckhardt/azure-functions-durable-python | 634f70887e415f0ff9e7ee1e2fb3f58f90112772 | [
"MIT"
] | 40 | 2020-03-31T19:52:31.000Z | 2022-02-06T05:52:44.000Z | import logging
import json
import azure.functions as func
import azure.durable_functions as df
async def main(req: func.HttpRequest, starter: str) -> func.HttpResponse:
client = df.DurableOrchestrationClient(starter)
payload: str = json.loads(req.get_body().decode()) # Load JSON post request data
instance... | 38.642857 | 96 | 0.770795 | import logging
import json
import azure.functions as func
import azure.durable_functions as df
async def main(req: func.HttpRequest, starter: str) -> func.HttpResponse:
client = df.DurableOrchestrationClient(starter)
payload: str = json.loads(req.get_body().decode())
instance_id = await client.start_new(... | true | true |
f72a9a3bdb59d938db776e22dab6ecf91d768216 | 9,420 | py | Python | Ryven/packages/auto_generated/ctypes.test.test_pickling/nodes.py | tfroehlich82/Ryven | cb57c91d13949712844a4410a9302c4a90d28dcd | [
"MIT"
] | 2,872 | 2020-07-01T09:06:34.000Z | 2022-03-31T05:52:32.000Z | Ryven/packages/auto_generated/ctypes.test.test_pickling/nodes.py | dhf327/Ryven | a11e361528d982a9dd3c489dd536f8b05ffd56e1 | [
"MIT"
] | 59 | 2020-06-28T12:50:50.000Z | 2022-03-27T19:07:54.000Z | Ryven/packages/auto_generated/ctypes.test.test_pickling/nodes.py | dhf327/Ryven | a11e361528d982a9dd3c489dd536f8b05ffd56e1 | [
"MIT"
] | 339 | 2020-07-05T04:36:20.000Z | 2022-03-24T07:25:18.000Z |
from NENV import *
import ctypes.test.test_pickling
class NodeBase(Node):
pass
class Array_Node(NodeBase):
"""
"""
title = 'ARRAY'
type_ = 'ctypes.test.test_pickling'
init_inputs = [
NodeInputBP(label='typ'),
NodeInputBP(label='len'),
]
init_outputs = [
... | 25.254692 | 120 | 0.619639 |
from NENV import *
import ctypes.test.test_pickling
class NodeBase(Node):
pass
class Array_Node(NodeBase):
title = 'ARRAY'
type_ = 'ctypes.test.test_pickling'
init_inputs = [
NodeInputBP(label='typ'),
NodeInputBP(label='len'),
]
init_outputs = [
NodeOutputBP(ty... | true | true |
f72a9b400fc3d0e9b4c84e2cd50ded8e71059a28 | 6,080 | py | Python | corehq/apps/smsforms/app.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/smsforms/app.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/smsforms/app.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | import re
import uuid
from xml.etree.cElementTree import XML, tostring
from django.conf import settings
from dimagi.utils.parsing import json_format_datetime
from corehq.apps.app_manager.util import get_cloudcare_session_data
from corehq.apps.cloudcare.touchforms_api import CaseSessionDataHelper
from corehq.apps.for... | 40.533333 | 157 | 0.702138 | import re
import uuid
from xml.etree.cElementTree import XML, tostring
from django.conf import settings
from dimagi.utils.parsing import json_format_datetime
from corehq.apps.app_manager.util import get_cloudcare_session_data
from corehq.apps.cloudcare.touchforms_api import CaseSessionDataHelper
from corehq.apps.for... | true | true |
f72a9b93aae1aefa7bf9852e1961a1a1a0e15237 | 667 | py | Python | src/actuariat_python/data/data_population/__init__.py | Pandinosaurus/actuariat_python | 77533a75fcc63a5a7ebca664a19a24c9439670ee | [
"MIT"
] | 5 | 2017-03-13T15:58:40.000Z | 2021-02-03T12:52:58.000Z | src/actuariat_python/data/data_population/__init__.py | Pandinosaurus/actuariat_python | 77533a75fcc63a5a7ebca664a19a24c9439670ee | [
"MIT"
] | 13 | 2015-06-14T22:01:37.000Z | 2021-01-05T13:57:00.000Z | src/actuariat_python/data/data_population/__init__.py | Pandinosaurus/actuariat_python | 77533a75fcc63a5a7ebca664a19a24c9439670ee | [
"MIT"
] | 9 | 2017-01-15T15:06:55.000Z | 2022-01-18T20:42:48.000Z | # -*- coding: utf-8 -*-
"""
@file
@brief Data from INSEE
**Source**
* ``irsocsd2014_G10.xlsx``: ?
* ``fm-fecondite-age-mere.csv``: `INSEE Bilan Démographique 2016 <https://www.insee.fr/fr/statistiques/1892259?sommaire=1912926>`_
* ``pop-totale-france.xlsx``: `INED Population totale
<https://www.ined.fr/fr/tout-savo... | 44.466667 | 130 | 0.724138 | true | true | |
f72a9be347a7824928143bcd46fdc086c947e678 | 18,930 | py | Python | orbital_utilities.py | desertfireballnetwork/DFN_darkflight | f41d2a2b82ce96f380f26acfe278c0afa536b9cd | [
"MIT"
] | 1 | 2020-10-19T15:13:09.000Z | 2020-10-19T15:13:09.000Z | orbital_utilities.py | desertfireballnetwork/DFN_darkflight | f41d2a2b82ce96f380f26acfe278c0afa536b9cd | [
"MIT"
] | null | null | null | orbital_utilities.py | desertfireballnetwork/DFN_darkflight | f41d2a2b82ce96f380f26acfe278c0afa536b9cd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Functions and objects to deal with meteoroids orbits
"""
__author__ = "Hadrien A.R. Devillepoix, Trent Jansen-Sturgeon "
__copyright__ = "Copyright 2016-2017, Desert Fireball Network"
__license__ = "MIT"
__version__ = "1.0"
import numpy as np
from numpy.linalg import norm
import matplotlib.p... | 37.485149 | 118 | 0.592974 |
__author__ = "Hadrien A.R. Devillepoix, Trent Jansen-Sturgeon "
__copyright__ = "Copyright 2016-2017, Desert Fireball Network"
__license__ = "MIT"
__version__ = "1.0"
import numpy as np
from numpy.linalg import norm
import matplotlib.pyplot as plt
from astropy import units as u
from astropy.time import Time
from as... | true | true |
f72a9c84ade667bf4db98b90f5ec6bc9cc38d9af | 5,205 | py | Python | tests/integration/modules/hosts.py | jeblair/salt | 24bdca62c1d43df198e07e54cbdd0e6397243f37 | [
"Apache-2.0"
] | 1 | 2020-09-06T16:03:14.000Z | 2020-09-06T16:03:14.000Z | tests/integration/modules/hosts.py | jeblair/salt | 24bdca62c1d43df198e07e54cbdd0e6397243f37 | [
"Apache-2.0"
] | null | null | null | tests/integration/modules/hosts.py | jeblair/salt | 24bdca62c1d43df198e07e54cbdd0e6397243f37 | [
"Apache-2.0"
] | null | null | null | '''
Test the hosts module
'''
# Import python libs
import os
import shutil
# Import Salt libs
import integration
HFN = os.path.join(integration.TMP, 'hosts')
class HostsModuleTest(integration.ModuleCase):
'''
Test the hosts module
'''
def __clean_hosts(self):
'''
Clean out the hosts f... | 36.914894 | 116 | 0.599039 |
import os
import shutil
import integration
HFN = os.path.join(integration.TMP, 'hosts')
class HostsModuleTest(integration.ModuleCase):
def __clean_hosts(self):
shutil.copyfile(os.path.join(integration.FILES, 'hosts'), HFN)
def __clear_hosts(self):
if os.path.isfile(HFN):
os.rem... | true | true |
f72a9c92bcaf6e4caffd7e1804851dab456f389c | 5,440 | py | Python | vi_engine_s.py | idigitopia/Distributed-VI | 323be8c50862d8dff9cae68313c518080a9df72e | [
"MIT"
] | 6 | 2019-08-18T17:04:36.000Z | 2022-03-26T08:31:22.000Z | vi_engine_s.py | idigitopia/Distributed-VI | 323be8c50862d8dff9cae68313c518080a9df72e | [
"MIT"
] | null | null | null | vi_engine_s.py | idigitopia/Distributed-VI | 323be8c50862d8dff9cae68313c518080a9df72e | [
"MIT"
] | null | null | null | import numpy as np
import ray
ray.shutdown()
ray.init()
# A : Action Space
# S : State Space
@ray.remote
class VI_worker(object):
def __init__(self, list_of_actions, tran_dict, reward_dict, beta, backup_states, true_action_prob=0.8,
unknown_value=0):
self.backup_states = backup_states
... | 34.871795 | 117 | 0.564154 | import numpy as np
import ray
ray.shutdown()
ray.init()
@ray.remote
class VI_worker(object):
def __init__(self, list_of_actions, tran_dict, reward_dict, beta, backup_states, true_action_prob=0.8,
unknown_value=0):
self.backup_states = backup_states
self.list_of_actions = list_... | true | true |
f72a9cb5225fd598744b0a2b231293e1f98ddf01 | 78 | py | Python | auto/utils/__init__.py | trisongz/autobot | d1c8eb419ec702a7b38877b4c299807d23692c3d | [
"MIT"
] | null | null | null | auto/utils/__init__.py | trisongz/autobot | d1c8eb419ec702a7b38877b4c299807d23692c3d | [
"MIT"
] | null | null | null | auto/utils/__init__.py | trisongz/autobot | d1c8eb419ec702a7b38877b4c299807d23692c3d | [
"MIT"
] | null | null | null | from .average_meter import AverageMeter
from .progress import TrainingProgress | 39 | 39 | 0.884615 | from .average_meter import AverageMeter
from .progress import TrainingProgress | true | true |
f72a9cc5d314217c9ae136b4edba4248c11cdb62 | 658 | py | Python | scripts/issue_terminal.py | gmatteo/awesome-panel | 7eb6965f4b3a7eca08c07561e631e5beb189ffd3 | [
"Apache-2.0"
] | 179 | 2019-12-04T14:54:53.000Z | 2022-03-30T09:08:38.000Z | scripts/issue_terminal.py | hbueno/awesome-panel | fb27bcaf265cef1278cfa0c78799fbbf6c9a6834 | [
"Apache-2.0"
] | 62 | 2019-12-14T16:51:28.000Z | 2022-03-19T18:47:12.000Z | scripts/issue_terminal.py | hbueno/awesome-panel | fb27bcaf265cef1278cfa0c78799fbbf6c9a6834 | [
"Apache-2.0"
] | 35 | 2019-12-08T13:19:53.000Z | 2022-03-25T10:33:02.000Z | import panel as pn
SCRIPT = """
<script src="https://www.unpkg.com/terminal@0.1.4/lib/terminal.js" type="text/javascript"></script>
"""
script_panel = pn.pane.HTML(SCRIPT, width=0, height=0, margin=0, sizing_mode="fixed")
HTML = """
<div id="terminal-1"></div>
<script>
var t1 = new Terminal()
t1.setHei... | 22.689655 | 100 | 0.635258 | import panel as pn
SCRIPT = """
<script src="https://www.unpkg.com/terminal@0.1.4/lib/terminal.js" type="text/javascript"></script>
"""
script_panel = pn.pane.HTML(SCRIPT, width=0, height=0, margin=0, sizing_mode="fixed")
HTML = """
<div id="terminal-1"></div>
<script>
var t1 = new Terminal()
t1.setHei... | true | true |
f72a9e641315711aa7910aa3b6ee493d2ef27967 | 822 | py | Python | server/article_topic/urls.py | cuongw/article-topic | 2022908590ada829c286d3f76a8450b4eb33f709 | [
"MIT"
] | 1 | 2020-10-21T18:16:27.000Z | 2020-10-21T18:16:27.000Z | server/article_topic/urls.py | 103cuong/article-topic | 2022908590ada829c286d3f76a8450b4eb33f709 | [
"MIT"
] | 2 | 2020-01-05T08:00:24.000Z | 2020-01-05T08:00:25.000Z | server/article_topic/urls.py | cuongw/article-topic | 2022908590ada829c286d3f76a8450b4eb33f709 | [
"MIT"
] | 1 | 2020-08-18T09:09:42.000Z | 2020-08-18T09:09:42.000Z | """article_topic URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 35.73913 | 77 | 0.715328 | from django.contrib import admin
from django.urls import path
from topic_detection import views
urlpatterns = [
path('admin/', admin.site.urls),
path('article/', views.index)
]
| true | true |
f72a9ee3f1f72fad4a331be0f301eba5e57a8290 | 17,450 | py | Python | apps/render_mandelbulb_slim.py | yyuting/learning_from_program_trace | e0e4ac9bc2d4069eef64bdc2de64a87a735fa508 | [
"MIT"
] | null | null | null | apps/render_mandelbulb_slim.py | yyuting/learning_from_program_trace | e0e4ac9bc2d4069eef64bdc2de64a87a735fa508 | [
"MIT"
] | null | null | null | apps/render_mandelbulb_slim.py | yyuting/learning_from_program_trace | e0e4ac9bc2d4069eef64bdc2de64a87a735fa508 | [
"MIT"
] | null | null | null | from render_util import *
from render_single import *
import numpy
import skimage
import skimage.io
def mb(p, time):
z = [p[0], p[1], p[2]]
dr = 1.0
t0 = 1.0
cond = True
power = 20.0
for i in range(4):
r = sqrt(z[0] ** 2.0 + z[1] ** 2.0 + z[2] ** 2.0)
#cond *= r <= 2.0
... | 40.962441 | 541 | 0.544413 | from render_util import *
from render_single import *
import numpy
import skimage
import skimage.io
def mb(p, time):
z = [p[0], p[1], p[2]]
dr = 1.0
t0 = 1.0
cond = True
power = 20.0
for i in range(4):
r = sqrt(z[0] ** 2.0 + z[1] ** 2.0 + z[2] ** 2.0)
cond ... | true | true |
f72a9f3994030f9517b36005ab3842f621032778 | 4,599 | py | Python | aliddns.py | k4nzdroid/ddns-client | d0177c17da145827a8b08800adc21f7f3e196b43 | [
"Apache-2.0"
] | null | null | null | aliddns.py | k4nzdroid/ddns-client | d0177c17da145827a8b08800adc21f7f3e196b43 | [
"Apache-2.0"
] | null | null | null | aliddns.py | k4nzdroid/ddns-client | d0177c17da145827a8b08800adc21f7f3e196b43 | [
"Apache-2.0"
] | null | null | null | from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkalidns.request.v20150109.DescribeSubDomainRecordsRequest import DescribeSubDomainRecordsRequest
from aliyunsdkalidns.request.v201... | 38.974576 | 113 | 0.719069 | from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkalidns.request.v20150109.DescribeSubDomainRecordsRequest import DescribeSubDomainRecordsRequest
from aliyunsdkalidns.request.v201... | true | true |
f72a9f4ec04b375aa26c8218249e75c1e2a2db4d | 3,486 | py | Python | bindings/python/ensmallen/datasets/string/halanaerobiumkushneri.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/halanaerobiumkushneri.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/halanaerobiumkushneri.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Halanaerobium kushneri.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein... | 33.2 | 223 | 0.679002 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def HalanaerobiumKushneri(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/str... | true | true |
f72aa007710dbb5ce8eb5bd9d8566a13f57787d4 | 36,004 | py | Python | tests/i18n/test_extraction.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-08-30T06:46:16.000Z | 2017-08-30T06:46:16.000Z | tests/i18n/test_extraction.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/i18n/test_extraction.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2018-07-23T12:13:04.000Z | 2018-07-23T12:13:04.000Z | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import shutil
import time
import warnings
from unittest import SkipTest, skipUnless
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_line
from djan... | 45.517067 | 113 | 0.644067 |
from __future__ import unicode_literals
import io
import os
import re
import shutil
import time
import warnings
from unittest import SkipTest, skipUnless
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_line
from django.core.management.base i... | true | true |
f72aa05957ea518052b423c49d9e13775118a954 | 8,920 | py | Python | downstream/UNITER/adapter/src/transformers/adapters/models/gpt2.py | yeonseok-jeong-cm/multimodal_research | bb1140f13f76d4cda6175a072806a0ee0908bd0d | [
"MIT"
] | null | null | null | downstream/UNITER/adapter/src/transformers/adapters/models/gpt2.py | yeonseok-jeong-cm/multimodal_research | bb1140f13f76d4cda6175a072806a0ee0908bd0d | [
"MIT"
] | null | null | null | downstream/UNITER/adapter/src/transformers/adapters/models/gpt2.py | yeonseok-jeong-cm/multimodal_research | bb1140f13f76d4cda6175a072806a0ee0908bd0d | [
"MIT"
] | null | null | null | from typing import Union
import torch
from torch import nn
from ..composition import AdapterCompositionBlock, parse_composition
from ..heads import CausalLMHead, ClassificationHead, MultiLabelClassificationHead
from ..model_mixin import InvertibleAdaptersMixin, ModelAdaptersMixin
from .bert import (
BertEncoderAd... | 40.545455 | 116 | 0.69361 | from typing import Union
import torch
from torch import nn
from ..composition import AdapterCompositionBlock, parse_composition
from ..heads import CausalLMHead, ClassificationHead, MultiLabelClassificationHead
from ..model_mixin import InvertibleAdaptersMixin, ModelAdaptersMixin
from .bert import (
BertEncoderAd... | true | true |
f72aa0e8cc0326318ce5bd49e2a78712241bce3f | 1,562 | py | Python | tests/test_elastic_service.py | occidere/blind-review-parser | 72dd3a3c897d87d79f9303597016801e5fb1c648 | [
"Apache-2.0"
] | 7 | 2021-02-15T16:43:20.000Z | 2021-03-23T17:10:47.000Z | tests/test_elastic_service.py | occidere/blind-review-parser | 72dd3a3c897d87d79f9303597016801e5fb1c648 | [
"Apache-2.0"
] | 8 | 2021-02-16T13:38:40.000Z | 2021-02-16T13:51:35.000Z | tests/test_elastic_service.py | occidere/blind-review-parser | 72dd3a3c897d87d79f9303597016801e5fb1c648 | [
"Apache-2.0"
] | null | null | null | import unittest
from blindreviewparser.parser.blind_review_parser import *
class TestElasticService(unittest.TestCase):
def setUp(self) -> None:
self.es_endpoint = 'http://localhost:9200'
self.elastic_service = ElasticService(self.es_endpoint)
self.sample = Review(
... | 30.038462 | 99 | 0.589629 | import unittest
from blindreviewparser.parser.blind_review_parser import *
class TestElasticService(unittest.TestCase):
def setUp(self) -> None:
self.es_endpoint = 'http://localhost:9200'
self.elastic_service = ElasticService(self.es_endpoint)
self.sample = Review(
... | true | true |
f72aa166383d481c6103f4761816a7c123b14e5f | 2,262 | py | Python | adb/systrace/catapult/devil/devil/android/tools/system_app_test.py | mohanedmoh/TBS | 6aebf52643911fe0dce7d02825eb0f046da1b3b1 | [
"Apache-2.0"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | adb/systrace/catapult/devil/devil/android/tools/system_app_test.py | mohanedmoh/TBS | 6aebf52643911fe0dce7d02825eb0f046da1b3b1 | [
"Apache-2.0"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | adb/systrace/catapult/devil/devil/android/tools/system_app_test.py | mohanedmoh/TBS | 6aebf52643911fe0dce7d02825eb0f046da1b3b1 | [
"Apache-2.0"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
# Copyright 2017 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.
import os
import sys
import unittest
if __name__ == '__main__':
sys.path.append(os.path.abspath(
os.path.join(os.path.dirname(... | 32.314286 | 72 | 0.751105 |
import os
import sys
import unittest
if __name__ == '__main__':
sys.path.append(os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..', '..')))
from devil import devil_env
from devil.android import device_utils
from devil.android.sdk import adb_wrapper
from devil.android.sdk import version_c... | true | true |
f72aa18c0f5b6396366947977df0c5e4b9da7877 | 264 | py | Python | tests/hamiltonian/test_exact.py | ymtz03/freqerica | d79e76181a037da5c11b47f8a4e1bf4387a0468f | [
"BSD-2-Clause"
] | 1 | 2020-05-08T15:28:04.000Z | 2020-05-08T15:28:04.000Z | tests/hamiltonian/test_exact.py | ymtz03/freqerica | d79e76181a037da5c11b47f8a4e1bf4387a0468f | [
"BSD-2-Clause"
] | null | null | null | tests/hamiltonian/test_exact.py | ymtz03/freqerica | d79e76181a037da5c11b47f8a4e1bf4387a0468f | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import freqerica.hamiltonian.exact
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
def test_absolute_truth_and_meaning(self):
assert True
if __name__ == '__main__':
unittest.main()
| 16.5 | 46 | 0.689394 |
import unittest
import freqerica.hamiltonian.exact
class BasicTestSuite(unittest.TestCase):
def test_absolute_truth_and_meaning(self):
assert True
if __name__ == '__main__':
unittest.main()
| true | true |
f72aa18da6b39da5e2c7c96f9b56b0327cc9cf0a | 1,301 | py | Python | authapp/forms.py | EvgenDEP1/exam | 0c6faf8986e890bc03f8a407fb3d72b7ccecc1e0 | [
"Apache-2.0"
] | null | null | null | authapp/forms.py | EvgenDEP1/exam | 0c6faf8986e890bc03f8a407fb3d72b7ccecc1e0 | [
"Apache-2.0"
] | null | null | null | authapp/forms.py | EvgenDEP1/exam | 0c6faf8986e890bc03f8a407fb3d72b7ccecc1e0 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth.models import User
class LoginForm(AuthenticationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['username'].label = ""
self.fields['password'].labe... | 40.65625 | 80 | 0.629516 | from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.contrib.auth.models import User
class LoginForm(AuthenticationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['username'].label = ""
self.fields['password'].labe... | true | true |
f72aa1cad8297f5101397a1f8105d26c2f65379d | 415 | py | Python | online_quiz/online_quiz/asgi.py | abhinavkavuri/django-trivia | e451ffd85a06ec9c1e1d690c67fdc51601fa6a5c | [
"Apache-2.0"
] | null | null | null | online_quiz/online_quiz/asgi.py | abhinavkavuri/django-trivia | e451ffd85a06ec9c1e1d690c67fdc51601fa6a5c | [
"Apache-2.0"
] | 6 | 2020-06-05T20:37:41.000Z | 2021-09-22T18:27:23.000Z | online_quiz/online_quiz/asgi.py | abhinavkavuri/django-trivia | e451ffd85a06ec9c1e1d690c67fdc51601fa6a5c | [
"Apache-2.0"
] | null | null | null | """
ASGI config for online_quiz 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.setdefa... | 24.411765 | 79 | 0.759036 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'online_quiz.settings')
application = get_asgi_application()
| true | true |
f72aa1e7883558de22bc21371e82becfb2c32478 | 1,010 | py | Python | server/routes/prometheus.py | sadiejay/Open-Sentencing-Model | fc83af2f37c9d77035349d1d39cf1cc309837045 | [
"Apache-2.0"
] | 52 | 2019-12-27T03:52:00.000Z | 2022-03-26T18:16:30.000Z | server/routes/prometheus.py | sadiejay/Open-Sentencing-Model | fc83af2f37c9d77035349d1d39cf1cc309837045 | [
"Apache-2.0"
] | 114 | 2019-12-03T04:13:38.000Z | 2020-10-03T18:02:03.000Z | server/routes/prometheus.py | sadiejay/Open-Sentencing-Model | fc83af2f37c9d77035349d1d39cf1cc309837045 | [
"Apache-2.0"
] | 45 | 2019-12-22T08:17:08.000Z | 2022-03-13T09:57:09.000Z |
from server import app
from flask import Response, request
from prometheus_client import generate_latest, Counter
from functools import wraps
# route to display configured Prometheus metrics
# note that you will need to set up custom metric observers for your app
@app.route('/metrics')
def prometheus_metrics():
M... | 31.5625 | 114 | 0.708911 |
from server import app
from flask import Response, request
from prometheus_client import generate_latest, Counter
from functools import wraps
@app.route('/metrics')
def prometheus_metrics():
MIMETYPE = 'text/plain; version=0.0.4; charset=utf-8'
return Response(generate_latest(), mimetype=MIMETYPE)
ro... | true | true |
f72aa29a2c3502ea40faf7f916df3b0ead8ebf1a | 1,577 | py | Python | xl2code/parsers/direct_parser.py | youlanhai/ExcelToCode | d160c75b9b7a305f4b3367d85ee0550572869d3e | [
"MIT"
] | 47 | 2017-06-23T07:47:50.000Z | 2022-03-07T22:36:19.000Z | xl2code/parsers/direct_parser.py | twjitm/ExcelToCode | d160c75b9b7a305f4b3367d85ee0550572869d3e | [
"MIT"
] | 1 | 2019-03-12T06:12:50.000Z | 2019-04-03T00:50:01.000Z | xl2code/parsers/direct_parser.py | twjitm/ExcelToCode | d160c75b9b7a305f4b3367d85ee0550572869d3e | [
"MIT"
] | 23 | 2017-05-12T07:46:07.000Z | 2022-01-22T03:19:50.000Z | # -*- coding: utf-8 -*-
import traceback
import xlsconfig
import util
from tps import tp0, convention
from base_parser import ConverterInfo, BaseParser
# 利用Excel表头描述,进行导表,不需要转换器
class DirectParser(BaseParser):
def __init__(self, filename, module, sheet_index=0):
super(DirectParser, self).__init__(filename, module,... | 30.326923 | 87 | 0.733037 |
import traceback
import xlsconfig
import util
from tps import tp0, convention
from base_parser import ConverterInfo, BaseParser
class DirectParser(BaseParser):
def __init__(self, filename, module, sheet_index=0):
super(DirectParser, self).__init__(filename, module, sheet_index)
self.field_row_index = xlsconfi... | true | true |
f72aa4256943cc8676fb4c07209c50e85fa11d40 | 4,050 | py | Python | examples/structural/beam.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | 1 | 2020-07-23T00:15:00.000Z | 2020-07-23T00:15:00.000Z | examples/structural/beam.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | null | null | null | examples/structural/beam.py | SzymonSzyszko/AeroPy | b061c690e5926fdd834b7c50837c25108e908156 | [
"MIT"
] | null | null | null | from aeropy.geometry.parametric import poly
from aeropy.structural.stable_solution import (structure, mesh_1D, properties,
boundary_conditions)
from aeropy.xfoil_module import output_reader
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
impo... | 36.486486 | 78 | 0.655062 | from aeropy.geometry.parametric import poly
from aeropy.structural.stable_solution import (structure, mesh_1D, properties,
boundary_conditions)
from aeropy.xfoil_module import output_reader
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
impo... | true | true |
f72aa529d44c10ff374c8d1442847033225d002f | 449 | py | Python | examples/subgraphs/create_knn_subgraph.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 26 | 2018-04-24T20:16:18.000Z | 2022-03-09T14:03:28.000Z | examples/subgraphs/create_knn_subgraph.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 4 | 2020-12-26T14:57:18.000Z | 2022-03-30T02:34:18.000Z | examples/subgraphs/create_knn_subgraph.py | gugarosa/opfython | 19b467a92d85c7c26d231efec770645096827b4e | [
"Apache-2.0"
] | 16 | 2019-05-20T15:41:56.000Z | 2022-03-23T17:59:53.000Z | import opfython.stream.loader as l
import opfython.stream.parser as p
from opfython.subgraphs import KNNSubgraph
# Defining an input file
input_file = 'data/boat.txt'
# Loading a .txt file to a dataframe
txt = l.load_txt(input_file)
# Parsing a pre-loaded dataframe
X, Y = p.parse_loader(txt)
# Creating a knn-subgra... | 23.631579 | 54 | 0.772829 | import opfython.stream.loader as l
import opfython.stream.parser as p
from opfython.subgraphs import KNNSubgraph
input_file = 'data/boat.txt'
txt = l.load_txt(input_file)
X, Y = p.parse_loader(txt)
g = KNNSubgraph(X, Y)
g = KNNSubgraph(from_file=input_file)
| true | true |
f72aa5fc954c18cf553f3deb747a7fd96e64bef0 | 2,664 | py | Python | ishuhui/controllers/admin.py | Nayak-cyber/flask_ishuhui | 34352da462d4999bc7788c87773001312a213b20 | [
"MIT"
] | 192 | 2017-08-27T13:56:37.000Z | 2022-03-09T00:59:14.000Z | ishuhui/controllers/admin.py | Soumi7/flask_ishuhui | a3444b3679c45d5ba94c5c9a66551207eff1a646 | [
"MIT"
] | null | null | null | ishuhui/controllers/admin.py | Soumi7/flask_ishuhui | a3444b3679c45d5ba94c5c9a66551207eff1a646 | [
"MIT"
] | 54 | 2017-08-28T01:04:04.000Z | 2021-07-07T17:27:50.000Z | from flask import Blueprint, render_template, current_app, session
from flask import abort, jsonify
from flask_login import current_user
import ishuhui.tasks.task as task
from ..models.chapter import Chapter
from ..models.comic import Comic
from ..tasks.celery_task import refresh_chapters_task
bp_admin = Blueprint('a... | 32.487805 | 77 | 0.614489 | from flask import Blueprint, render_template, current_app, session
from flask import abort, jsonify
from flask_login import current_user
import ishuhui.tasks.task as task
from ..models.chapter import Chapter
from ..models.comic import Comic
from ..tasks.celery_task import refresh_chapters_task
bp_admin = Blueprint('a... | true | true |
f72aa61a7732c6e419535219feafdd67e09bdfe5 | 5,711 | py | Python | doors/gatekeeper_app.py | manens/nadine | 4938afa2d2c69ae5ac54f4360b081d10521a0a2f | [
"Apache-2.0"
] | null | null | null | doors/gatekeeper_app.py | manens/nadine | 4938afa2d2c69ae5ac54f4360b081d10521a0a2f | [
"Apache-2.0"
] | null | null | null | doors/gatekeeper_app.py | manens/nadine | 4938afa2d2c69ae5ac54f4360b081d10521a0a2f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import json
import time
import logging
import traceback
from core import Messages, EncryptedConnection, Gatekeeper
from threads import Heartbeat, EventWatcher
class GatekeeperApp(object):
def run(self, config):
try:
logging.info("Starting up Gatekeeper...")
... | 42.93985 | 583 | 0.555244 |
import sys
import json
import time
import logging
import traceback
from core import Messages, EncryptedConnection, Gatekeeper
from threads import Heartbeat, EventWatcher
class GatekeeperApp(object):
def run(self, config):
try:
logging.info("Starting up Gatekeeper...")
gatekeeper =... | true | true |
f72aa63243daf6a11e454d0ec669bad1d564b255 | 4,178 | py | Python | src/dataAnalyze.py | bankrollhunter/DreamTrader | c8f2f9043b0ff11a67146007b6f952fca05a629d | [
"MIT"
] | 32 | 2020-10-16T17:48:04.000Z | 2021-06-16T06:14:31.000Z | src/dataAnalyze.py | bankrollhunter/DreamTrader | c8f2f9043b0ff11a67146007b6f952fca05a629d | [
"MIT"
] | null | null | null | src/dataAnalyze.py | bankrollhunter/DreamTrader | c8f2f9043b0ff11a67146007b6f952fca05a629d | [
"MIT"
] | 19 | 2020-10-16T17:13:27.000Z | 2021-05-26T02:44:56.000Z | from .dataSource import DataSource
from .trend import TrendAnalyze
from jqdatasdk import *
from jqdatasdk.api import get_fundamentals, get_industry_stocks, get_security_info
from jqdatasdk.utils import query
import talib
from datetime import datetime, timedelta
import json
import logging
from sqlalchemy.orm.query impo... | 30.057554 | 105 | 0.533748 | from .dataSource import DataSource
from .trend import TrendAnalyze
from jqdatasdk import *
from jqdatasdk.api import get_fundamentals, get_industry_stocks, get_security_info
from jqdatasdk.utils import query
import talib
from datetime import datetime, timedelta
import json
import logging
from sqlalchemy.orm.query impo... | true | true |
f72aa66497de214ed535e744d03638f19d86133b | 2,551 | py | Python | test/old/Old2/modules/SCF.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | test/old/Old2/modules/SCF.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | test/old/Old2/modules/SCF.py | pulsar-chem/BPModule | f8e64e04fdb01947708f098e833600c459c2ff0e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
thispath = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(os.path.dirname(thispath),"helper"))
from MiscFxns import *
from StandardModules import *
def CompareEgy(EgyIn):
return EgyIn+224.912529687124<0.00001
def CompareGrad(GradIn):
Cor... | 33.565789 | 79 | 0.642101 |
import os
import sys
thispath = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(os.path.dirname(thispath),"helper"))
from MiscFxns import *
from StandardModules import *
def CompareEgy(EgyIn):
return EgyIn+224.912529687124<0.00001
def CompareGrad(GradIn):
CorrectGrad=[
0.006... | true | true |
f72aa69c7ec0962f39e0a42210cdf6e5308bb185 | 801 | py | Python | scripts/utils.py | onchere/whack | 0702e46f13855d4efd8dd0cb67af2fddfb84b00c | [
"Apache-2.0"
] | 54 | 2018-10-28T07:18:31.000Z | 2022-03-08T20:30:40.000Z | scripts/utils.py | onchere/whack | 0702e46f13855d4efd8dd0cb67af2fddfb84b00c | [
"Apache-2.0"
] | null | null | null | scripts/utils.py | onchere/whack | 0702e46f13855d4efd8dd0cb67af2fddfb84b00c | [
"Apache-2.0"
] | 5 | 2018-10-28T14:43:53.000Z | 2020-04-26T19:52:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 Onchere Bironga
#
# 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 re... | 30.807692 | 74 | 0.714107 |
def read(filename):
with open(filename, "r") as f:
return f.read()
def write(filename, contents):
with open(filename, "w+") as f:
f.write(contents)
| true | true |
f72aa75a0f0acb3039551b59174f7f22257880d1 | 31,650 | py | Python | credit_default/app/views.py | sandymule/Credit-Card-Default | c9d67feffa65fb7aad514bd9c1991766e8e2777b | [
"MIT"
] | 1 | 2017-05-20T06:08:05.000Z | 2017-05-20T06:08:05.000Z | credit_default/app/views.py | sandymule/credit-card-default | c9d67feffa65fb7aad514bd9c1991766e8e2777b | [
"MIT"
] | null | null | null | credit_default/app/views.py | sandymule/credit-card-default | c9d67feffa65fb7aad514bd9c1991766e8e2777b | [
"MIT"
] | 2 | 2017-05-20T06:08:25.000Z | 2019-05-18T19:59:31.000Z | import logging
import json
import pandas as pd
from flask import render_template
from flask_wtf import Form
from wtforms import fields
from wtforms.validators import Required
from . import app, estimator, target_names
logger = logging.getLogger('app')
class PredictForm(Form):
"""Fields for Predict"""
# sepa... | 58.938547 | 156 | 0.576461 | import logging
import json
import pandas as pd
from flask import render_template
from flask_wtf import Form
from wtforms import fields
from wtforms.validators import Required
from . import app, estimator, target_names
logger = logging.getLogger('app')
class PredictForm(Form):
Limit_bal = fie... | true | true |
f72aa7ac988a87f3f873350a9bce3b67813e99a1 | 188 | py | Python | lessons/ObjectOrientedProgramming/IdeFiles/3a_python_package/setup.py | cnegrelli/DSND_Term2 | c69a654a7d492ce895c9b835b6c05e89eef84a1b | [
"MIT"
] | null | null | null | lessons/ObjectOrientedProgramming/IdeFiles/3a_python_package/setup.py | cnegrelli/DSND_Term2 | c69a654a7d492ce895c9b835b6c05e89eef84a1b | [
"MIT"
] | null | null | null | lessons/ObjectOrientedProgramming/IdeFiles/3a_python_package/setup.py | cnegrelli/DSND_Term2 | c69a654a7d492ce895c9b835b6c05e89eef84a1b | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name = 'distributions',
version = '0.2',
description = 'Gaussian distributions',
packages = ['distributions'],
zip_safe = False) | 26.857143 | 45 | 0.648936 | from setuptools import setup
setup(name = 'distributions',
version = '0.2',
description = 'Gaussian distributions',
packages = ['distributions'],
zip_safe = False) | true | true |
f72aa85d1d51fabcb355ee1ffa6f5c5410b545f6 | 27,086 | py | Python | nuitka/tree/ReformulationFunctionStatements.py | augustand/Nuitka | b7b9dd50b60505a309f430ce17cad36fb7d75048 | [
"Apache-2.0"
] | null | null | null | nuitka/tree/ReformulationFunctionStatements.py | augustand/Nuitka | b7b9dd50b60505a309f430ce17cad36fb7d75048 | [
"Apache-2.0"
] | null | null | null | nuitka/tree/ReformulationFunctionStatements.py | augustand/Nuitka | b7b9dd50b60505a309f430ce17cad36fb7d75048 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 32.283671 | 96 | 0.558554 |
from nuitka.nodes.AssignNodes import (
ExpressionTargetTempVariableRef,
ExpressionTargetVariableRef,
StatementAssignmentVariable,
StatementReleaseVariable
)
from nuitka.nodes.BuiltinIteratorNodes import (
ExpressionBuiltinIter1,
StatementSpecialUnpackCheck
)
from nuitka.nodes.B... | true | true |
f72aaada40c2662f3b0cfa6fbf29805cd48bed68 | 3,807 | py | Python | argo/workflows/client/models/v1alpha1_metrics.py | jyotishp/argo-client-python | 7dfe27c8bc542a9142efcb0a8f55bb85c915448c | [
"Apache-2.0"
] | 1 | 2021-03-10T23:09:42.000Z | 2021-03-10T23:09:42.000Z | argo/workflows/client/models/v1alpha1_metrics.py | jyotishp/argo-client-python | 7dfe27c8bc542a9142efcb0a8f55bb85c915448c | [
"Apache-2.0"
] | null | null | null | argo/workflows/client/models/v1alpha1_metrics.py | jyotishp/argo-client-python | 7dfe27c8bc542a9142efcb0a8f55bb85c915448c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Argo Server API
You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501
The version of the OpenAPI document: v2.11.8
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
... | 30.701613 | 134 | 0.599947 |
import pprint
import re
import six
from argo.workflows.client.configuration import Configuration
class V1alpha1Metrics(object):
openapi_types = {
'prometheus': 'list[V1alpha1Prometheus]'
}
attribute_map = {
'prometheus': 'prometheus'
}
def __init__(self, prometheus=None,... | true | true |
f72aabfa532e7c390422910aefe539d8af6b71e5 | 4,802 | py | Python | cnn_training.py | xiangzhemeng/epfl-ml2017-project2 | 16345b3e453989dfeba70667773b76362897a782 | [
"MIT"
] | 11 | 2018-12-11T05:59:50.000Z | 2020-09-30T03:01:02.000Z | cnn_training.py | xiangzhemeng/epfl-ml2017-project2 | 16345b3e453989dfeba70667773b76362897a782 | [
"MIT"
] | 1 | 2019-02-28T15:51:26.000Z | 2019-02-28T15:51:26.000Z | cnn_training.py | xiangzhemeng/epfl-ml2017-project2 | 16345b3e453989dfeba70667773b76362897a782 | [
"MIT"
] | 3 | 2018-03-06T07:34:39.000Z | 2018-05-28T03:13:32.000Z | import pandas as pd
import numpy as np
import pickle
from keras.preprocessing.text import Tokenizer
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers.convolutional import Conv1D
from keras.layers.convolutional import MaxPooling1D... | 37.515625 | 145 | 0.704082 | import pandas as pd
import numpy as np
import pickle
from keras.preprocessing.text import Tokenizer
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers.convolutional import Conv1D
from keras.layers.convolutional import MaxPooling1D... | true | true |
f72aacfc0d05c9205783f92c37e379035bd0665e | 5,592 | py | Python | Doc/conf.py | whtsky/python | 715a6e5035bb21ac49382772076ec4c630d6e960 | [
"PSF-2.0"
] | 2 | 2018-12-22T08:20:13.000Z | 2020-06-24T02:48:52.000Z | Doc/conf.py | whtsky/python | 715a6e5035bb21ac49382772076ec4c630d6e960 | [
"PSF-2.0"
] | null | null | null | Doc/conf.py | whtsky/python | 715a6e5035bb21ac49382772076ec4c630d6e960 | [
"PSF-2.0"
] | 3 | 2018-03-06T05:12:17.000Z | 2021-04-22T10:01:01.000Z | # -*- coding: utf-8 -*-
#
# Python documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
... | 30.557377 | 82 | 0.669886 |
# that aren't pickleable (module imports are okay, they're removed automatically).
import sys, os, time
sys.path.append(os.path.abspath('tools/sphinxext'))
# General configuration
# ---------------------
extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage',
'sphinx.ext.doctest', 'pyspec... | true | true |
f72aad60b115d3fd47a1a6dd7076ff1a07ca0230 | 140 | py | Python | tests/data/config1.py | seismopy/figcon | 7e5d6ac30ea49bce8a566f9afb7e9e5af081164c | [
"BSD-3-Clause"
] | null | null | null | tests/data/config1.py | seismopy/figcon | 7e5d6ac30ea49bce8a566f9afb7e9e5af081164c | [
"BSD-3-Clause"
] | null | null | null | tests/data/config1.py | seismopy/figcon | 7e5d6ac30ea49bce8a566f9afb7e9e5af081164c | [
"BSD-3-Clause"
] | null | null | null | """
The first config example
"""
from types import SimpleNamespace
agency = 'NSA'
snuffler = SimpleNamespace(phase_map={1: 'P', 2: 'S'})
| 14 | 54 | 0.685714 | from types import SimpleNamespace
agency = 'NSA'
snuffler = SimpleNamespace(phase_map={1: 'P', 2: 'S'})
| true | true |
f72aadc6e09185ea3c69fa953e810a4ae3a1ee00 | 1,277 | py | Python | cc_backend_lib/models/scales.py | prio-data/cc_backend_lib | 7daa3c38d96e9063074367ea0873e39d7544e2b7 | [
"MIT"
] | null | null | null | cc_backend_lib/models/scales.py | prio-data/cc_backend_lib | 7daa3c38d96e9063074367ea0873e39d7544e2b7 | [
"MIT"
] | null | null | null | cc_backend_lib/models/scales.py | prio-data/cc_backend_lib | 7daa3c38d96e9063074367ea0873e39d7544e2b7 | [
"MIT"
] | null | null | null | """
The intensity measurement scale has changed, and might change again
Therefore, I need this module to translate between numeric intensity scores
and casualty numbers
"""
from typing import Optional
from datetime import date
import pydantic
class CasualtyRange(pydantic.BaseModel):
lower: int
upper: Optional[... | 30.404762 | 75 | 0.649961 | from typing import Optional
from datetime import date
import pydantic
class CasualtyRange(pydantic.BaseModel):
lower: int
upper: Optional[int]
text: Optional[str]
@property
def zero(self):
return self.upper == 0
SCALES = {
date(1,1,1):{
0: CasualtyRange(lower=0,upper=... | true | true |
f72aadee17de447d48becb2d1e2d660cbd57c250 | 3,508 | py | Python | third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python
# Copyright 2016 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.
import json5_generator
import template_expander
from collections import namedtuple
from core.css import css_properties
class Propert... | 37.319149 | 85 | 0.686431 |
import json5_generator
import template_expander
from collections import namedtuple
from core.css import css_properties
class PropertyClassData(
namedtuple(
'PropertyClassData',
'enum_key,enum_value,property_id,classname,namespace_group,filename'
)):
pass
class CSSPr... | true | true |
f72aae9d51b7f0153c0b16c546eb1ceaa7d6f438 | 777 | py | Python | web/data/migrations/0003_auto_20210108_1000.py | liwan1698/CatchingFire | 74535cba4b6da178eed2857d5db9900604c0c5f7 | [
"MIT"
] | 11 | 2021-02-14T15:56:22.000Z | 2022-03-21T08:26:58.000Z | web/data/migrations/0003_auto_20210108_1000.py | liwan1698/CatchingFire | 74535cba4b6da178eed2857d5db9900604c0c5f7 | [
"MIT"
] | null | null | null | web/data/migrations/0003_auto_20210108_1000.py | liwan1698/CatchingFire | 74535cba4b6da178eed2857d5db9900604c0c5f7 | [
"MIT"
] | 6 | 2021-03-16T14:30:12.000Z | 2022-03-10T14:20:24.000Z | # Generated by Django 3.1.5 on 2021-01-08 10:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0002_remove_classifydata_pending_tag'),
]
operations = [
migrations.CreateModel(
name='ClassifyTag',
fields=... | 29.884615 | 114 | 0.593308 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0002_remove_classifydata_pending_tag'),
]
operations = [
migrations.CreateModel(
name='ClassifyTag',
fields=[
('id', models.AutoField(auto_... | true | true |
f72aaeb6bcf064edb9fbce86a27a4b372ec8bac8 | 9,321 | py | Python | kernel/protobuf/generated/pearson_model_param_pb2.py | rinceyuan/WeFe | 8482cb737cb7ba37b2856d184cd42c1bd35a6318 | [
"Apache-2.0"
] | 39 | 2021-10-12T01:43:27.000Z | 2022-03-28T04:46:35.000Z | kernel/protobuf/generated/pearson_model_param_pb2.py | rinceyuan/WeFe | 8482cb737cb7ba37b2856d184cd42c1bd35a6318 | [
"Apache-2.0"
] | 6 | 2021-10-14T02:11:47.000Z | 2022-03-23T02:41:50.000Z | kernel/protobuf/generated/pearson_model_param_pb2.py | rinceyuan/WeFe | 8482cb737cb7ba37b2856d184cd42c1bd35a6318 | [
"Apache-2.0"
] | 10 | 2021-10-14T09:36:03.000Z | 2022-02-10T11:05:12.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pearson-model-param.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database ... | 45.247573 | 747 | 0.695848 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='pear... | true | true |
f72aaed00855b0147da7146ad4481dc9c1de0fae | 7,616 | py | Python | sig.py | IlyaKodua/colorization_with_averaging_ab_channels_test | 425a9f3e8b875b21c76424e892cbf489a9e408cb | [
"MIT"
] | null | null | null | sig.py | IlyaKodua/colorization_with_averaging_ab_channels_test | 425a9f3e8b875b21c76424e892cbf489a9e408cb | [
"MIT"
] | null | null | null | sig.py | IlyaKodua/colorization_with_averaging_ab_channels_test | 425a9f3e8b875b21c76424e892cbf489a9e408cb | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class SIGGRAPHGenerator(nn.Module):
def __init__(self, norm_layer=nn.BatchNorm2d, classes=529):
super(SIGGRAPHGenerator, self).__init__()
# Conv1
model1=[nn.Conv2d(4, 64, kernel_size=3, stride=1, padding=1, bias=True),]
... | 43.028249 | 157 | 0.616334 | import torch
import torch.nn as nn
import torch.nn.functional as F
class SIGGRAPHGenerator(nn.Module):
def __init__(self, norm_layer=nn.BatchNorm2d, classes=529):
super(SIGGRAPHGenerator, self).__init__()
model1=[nn.Conv2d(4, 64, kernel_size=3, stride=1, padding=1, bias=True),]
mo... | true | true |
f72aaf0d1aeed3ebfc53a15203a1be8e842a5f86 | 1,624 | py | Python | landmark_recognition/urls.py | MilanSusa/Landmark-Recognition-Inference-API | e770fd8dce1b7dc39e52950c71e6406352a67123 | [
"MIT"
] | null | null | null | landmark_recognition/urls.py | MilanSusa/Landmark-Recognition-Inference-API | e770fd8dce1b7dc39e52950c71e6406352a67123 | [
"MIT"
] | 11 | 2020-11-13T18:40:49.000Z | 2022-03-12T00:20:31.000Z | landmark_recognition/urls.py | MilanSusa/Landmark-Recognition-Inference-API | e770fd8dce1b7dc39e52950c71e6406352a67123 | [
"MIT"
] | null | null | null | """landmark_recognition URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home'... | 38.666667 | 108 | 0.721675 | from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
schema_view = get_schema_vie... | true | true |
f72aaf58fab32e715e1c98ff0e845edadd9fd68c | 3,567 | py | Python | examples/ariadne_uvicorn/movies_v4.py | jyoost/neo4j-graphql-py | 14dbd8f133727f89ec8ea79e5475e4a940d4e55f | [
"Apache-2.0"
] | null | null | null | examples/ariadne_uvicorn/movies_v4.py | jyoost/neo4j-graphql-py | 14dbd8f133727f89ec8ea79e5475e4a940d4e55f | [
"Apache-2.0"
] | null | null | null | examples/ariadne_uvicorn/movies_v4.py | jyoost/neo4j-graphql-py | 14dbd8f133727f89ec8ea79e5475e4a940d4e55f | [
"Apache-2.0"
] | null | null | null | import uvicorn
from neo4j import GraphDatabase
from ariadne.asgi import GraphQL
from neo4j_graphql_py import neo4j_graphql
from ariadne import QueryType, make_executable_schema, MutationType, gql
typeDefs = gql('''
directive @cypher(statement: String!) on FIELD_DEFINITION
directive @relation(name:String!, direction:St... | 31.566372 | 166 | 0.702832 | import uvicorn
from neo4j import GraphDatabase
from ariadne.asgi import GraphQL
from neo4j_graphql_py import neo4j_graphql
from ariadne import QueryType, make_executable_schema, MutationType, gql
typeDefs = gql('''
directive @cypher(statement: String!) on FIELD_DEFINITION
directive @relation(name:String!, direction:St... | true | true |
f72ab07a46237929635bd213f93c69e456b0ae1e | 2,868 | py | Python | modules/storage/PrefabS3Scality.py | threefoldtech/jumpscale_prefab9 | 75cb6267618d9087d4a9a7eaad121a14e497f07d | [
"Apache-2.0"
] | null | null | null | modules/storage/PrefabS3Scality.py | threefoldtech/jumpscale_prefab9 | 75cb6267618d9087d4a9a7eaad121a14e497f07d | [
"Apache-2.0"
] | 31 | 2018-07-31T15:40:07.000Z | 2019-02-20T11:07:15.000Z | modules/storage/PrefabS3Scality.py | threefoldtech/jumpscale_prefab | 75cb6267618d9087d4a9a7eaad121a14e497f07d | [
"Apache-2.0"
] | null | null | null | from jumpscale import j
from time import sleep
app = j.tools.prefab._getBaseAppClass()
class PrefabS3Scality(app):
NAME = 's3scality'
def install(self, start=False, storageLocation="/data/", metaLocation="/meta/"):
"""
put backing store on /storage/...
"""
self.prefab.system... | 43.454545 | 107 | 0.658996 | from jumpscale import j
from time import sleep
app = j.tools.prefab._getBaseAppClass()
class PrefabS3Scality(app):
NAME = 's3scality'
def install(self, start=False, storageLocation="/data/", metaLocation="/meta/"):
self.prefab.system.package.mdupdate()
self.prefab.system.package.install('bu... | true | true |
f72ab0a07e44dd8dfddbb6dd81911777030d7752 | 3,238 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_configuration.py | NateLehman/azure-sdk-for-python | 82fcc5a5e9e01c3b7f6ab24fccbafad19149e400 | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_configuration.py | NateLehman/azure-sdk-for-python | 82fcc5a5e9e01c3b7f6ab24fccbafad19149e400 | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/privatelinks/v2020_05_01/_configuration.py | NateLehman/azure-sdk-for-python | 82fcc5a5e9e01c3b7f6ab24fccbafad19149e400 | [
"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 ... | 46.927536 | 125 | 0.693638 |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
from azure.core.credentials im... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.