hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72d4d256b09e12e5ab72b4beb08439fff8b274f | 3,811 | py | Python | networkx/algorithms/simple_paths.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 6 | 2017-08-18T07:30:40.000Z | 2021-07-08T02:57:36.000Z | networkx/algorithms/simple_paths.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 2 | 2016-10-06T13:07:05.000Z | 2017-12-20T09:47:08.000Z | networkx/algorithms/simple_paths.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 4 | 2016-04-25T22:15:40.000Z | 2017-12-18T14:40:58.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2012 by
# Sergio Nery Simoes <sergionery@gmail.com>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """\n""".join(['Sérgio Nery Simões <sergionery@gmail.com>',
'Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['a... | 30.488 | 78 | 0.568617 | import networkx as nx
__author__ = """\n""".join(['Sérgio Nery Simões <sergionery@gmail.com>',
'Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['all_simple_paths']
def all_simple_paths(G, source, target, cutoff=None):
if source not in G:
raise nx.NetworkXError('source node %... | true | true |
f72d4d2fdf905ec644db0080a322da124ae18054 | 3,700 | py | Python | mlp/src/mlp_numpy.py | akashrajkn/sarcastic-gradients | 5a995ab7822dfd49cdc88855c631dcc8f1b0532f | [
"Apache-2.0"
] | null | null | null | mlp/src/mlp_numpy.py | akashrajkn/sarcastic-gradients | 5a995ab7822dfd49cdc88855c631dcc8f1b0532f | [
"Apache-2.0"
] | null | null | null | mlp/src/mlp_numpy.py | akashrajkn/sarcastic-gradients | 5a995ab7822dfd49cdc88855c631dcc8f1b0532f | [
"Apache-2.0"
] | null | null | null | """
This module implements a multi-layer perceptron (MLP) in NumPy.
You should fill in code into indicated sections.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from modules import *
class MLP(object):
"""
This class implements a Multi-laye... | 31.355932 | 95 | 0.609459 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from modules import *
class MLP(object):
def __init__(self, n_inputs, n_hidden, n_classes):
if len(n_hidden) == 0:
self.input_layer = LinearModule(n_inputs, n_classes)
else:
... | true | true |
f72d4ea900979ff121f13afed4e4fdf730a65273 | 5,203 | py | Python | disf_gen_coarse2fine/table/Loss.py | GT-SALT/Disfluency-Generation-and-Detection | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 11 | 2020-10-19T21:52:58.000Z | 2022-02-23T02:28:57.000Z | disf_gen_coarse2fine/table/Loss.py | JingfengYang/Disfluency-Generation-and-Detection-1 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 4 | 2021-07-09T11:59:03.000Z | 2022-02-10T00:58:25.000Z | disf_gen_coarse2fine/table/Loss.py | JingfengYang/Disfluency-Generation-and-Detection-1 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 5 | 2021-06-18T08:05:51.000Z | 2022-02-18T04:09:17.000Z | """
This file handles the details of the loss function during training.
This includes: LossComputeBase and the standard NMTLossCompute, and
sharded loss compute stuff.
"""
from __future__ import division
from itertools import count
import torch
import torch.nn as nn
import random as rnd
import table
d... | 38.540741 | 121 | 0.610994 | from __future__ import division
from itertools import count
import torch
import torch.nn as nn
import random as rnd
import table
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class CopyGeneratorLoss(nn.Module):
def __init__(self, vocab_size, force_copy, only_disf_loss, unk_index=0,
... | true | true |
f72d4f5f379c640e9958f7aad5d2a4526ab22302 | 1,325 | py | Python | apps/rss_feeds/management/commands/mark_read.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | 3,073 | 2015-01-01T07:20:18.000Z | 2022-03-31T20:33:41.000Z | apps/rss_feeds/management/commands/mark_read.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | 1,054 | 2015-01-02T13:32:35.000Z | 2022-03-30T04:21:21.000Z | apps/rss_feeds/management/commands/mark_read.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | 676 | 2015-01-03T16:40:29.000Z | 2022-03-30T14:00:40.000Z | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from apps.reader.models import UserSubscription
import datetime
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("-d", "--days", dest="days", nargs=1, default=1, help="Days of un... | 44.166667 | 111 | 0.626415 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from apps.reader.models import UserSubscription
import datetime
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("-d", "--days", dest="days", nargs=1, default=1, help="Days of un... | true | true |
f72d4f7e7d807286e5c6688975bbbba1e0d587a4 | 3,185 | py | Python | Lab/adventofcode2020/day12.py | hscspring/TheAlgorithms-Python | 5c2faea1d2d25a9a81a4786e053b0cc58ab46c6f | [
"MIT"
] | 10 | 2020-07-06T11:00:58.000Z | 2022-01-29T09:25:24.000Z | Lab/adventofcode2020/day12.py | hscspring/TheAlgorithms-Python | 5c2faea1d2d25a9a81a4786e053b0cc58ab46c6f | [
"MIT"
] | null | null | null | Lab/adventofcode2020/day12.py | hscspring/TheAlgorithms-Python | 5c2faea1d2d25a9a81a4786e053b0cc58ab46c6f | [
"MIT"
] | 3 | 2020-07-13T06:39:23.000Z | 2020-08-15T16:29:48.000Z | import pnlp
DIRECTS = ["E", "S", "W", "N"]
SIGNS = ["++", "+-", "--", "-+"]
def get_direct(directs: list, direct: str, num: int, rotate: str):
count = num // 90
idx = directs.index(direct)
if rotate == "R":
new_idx = idx + count
return directs[new_idx % 4]
else:
new_idx = idx ... | 25.277778 | 66 | 0.475039 | import pnlp
DIRECTS = ["E", "S", "W", "N"]
SIGNS = ["++", "+-", "--", "-+"]
def get_direct(directs: list, direct: str, num: int, rotate: str):
count = num // 90
idx = directs.index(direct)
if rotate == "R":
new_idx = idx + count
return directs[new_idx % 4]
else:
new_idx = idx ... | true | true |
f72d4fd3cbefd1e5e02930d93c37bbd0e45283f5 | 13,700 | py | Python | openconcept/components/splitter.py | vrsub/openconcept | 459aa24269cf54122ee4cfb3edf173c79c880be9 | [
"MIT"
] | null | null | null | openconcept/components/splitter.py | vrsub/openconcept | 459aa24269cf54122ee4cfb3edf173c79c880be9 | [
"MIT"
] | null | null | null | openconcept/components/splitter.py | vrsub/openconcept | 459aa24269cf54122ee4cfb3edf173c79c880be9 | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
from openmdao.api import ExplicitComponent
from openmdao.api import Group
class PowerSplit(ExplicitComponent):
"""
A power split mechanism for mechanical or electrical power.
Inputs
------
power_in : float
Power fed to the splitter. (vect... | 44.625407 | 136 | 0.606788 | from __future__ import division
import numpy as np
from openmdao.api import ExplicitComponent
from openmdao.api import Group
class PowerSplit(ExplicitComponent):
def initialize(self):
self.options.declare('num_nodes', default=1, desc='Number of flight/control conditions')
self.options.decl... | true | true |
f72d50746d095eb7757591129699b6a2bf403e6e | 1,956 | py | Python | 56_interactive_watershed.py | amit-bohra/Interactive-Image-Segmentation-with-OpenCV-Watershed-Algorithm-in-Python3 | 9fd6e2551fe19af76f1c91c714ba029d2d8599ca | [
"MIT"
] | null | null | null | 56_interactive_watershed.py | amit-bohra/Interactive-Image-Segmentation-with-OpenCV-Watershed-Algorithm-in-Python3 | 9fd6e2551fe19af76f1c91c714ba029d2d8599ca | [
"MIT"
] | null | null | null | 56_interactive_watershed.py | amit-bohra/Interactive-Image-Segmentation-with-OpenCV-Watershed-Algorithm-in-Python3 | 9fd6e2551fe19af76f1c91c714ba029d2d8599ca | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from copy import deepcopy as dp
aqua=(255,255,0)
marine=(116,139,69)
banana=(87,207,277)
blue=(255,0,0)
almond=(205,235,255)
brown=(64,64,255)
blue1=(255,245,152)
green=(0,100,0)
orange=(0,140,255)
orchid=(139,34,104)
pink=(147,20,255)
gold=(0,215,255)
gray=(127,127,127)
... | 25.076923 | 72 | 0.625767 | import cv2
import numpy as np
from copy import deepcopy as dp
aqua=(255,255,0)
marine=(116,139,69)
banana=(87,207,277)
blue=(255,0,0)
almond=(205,235,255)
brown=(64,64,255)
blue1=(255,245,152)
green=(0,100,0)
orange=(0,140,255)
orchid=(139,34,104)
pink=(147,20,255)
gold=(0,215,255)
gray=(127,127,127)
... | true | true |
f72d5149c0def6142cc248614e148e566f00322a | 2,120 | py | Python | rllib/examples/serving/cartpole_server.py | brechtmann/ray | 0c76ebd676f794847ea990aecced22b88717d09e | [
"Apache-2.0"
] | 4 | 2019-10-18T17:44:58.000Z | 2021-04-14T14:37:21.000Z | rllib/examples/serving/cartpole_server.py | Eric2Hamel/ray | bfaee49880611a65d16a4561c94c60851573b6f2 | [
"Apache-2.0"
] | 1 | 2022-03-30T17:52:44.000Z | 2022-03-30T17:52:44.000Z | rllib/examples/serving/cartpole_server.py | Eric2Hamel/ray | bfaee49880611a65d16a4561c94c60851573b6f2 | [
"Apache-2.0"
] | 1 | 2020-06-26T07:54:25.000Z | 2020-06-26T07:54:25.000Z | """Example of running a policy server. Copy this file for your use case.
To try this out, in two separate shells run:
$ python cartpole_server.py
$ python cartpole_client.py
"""
import os
from gym import spaces
import numpy as np
import ray
from ray.rllib.agents.dqn import DQNTrainer
from ray.rllib.env.exter... | 31.641791 | 77 | 0.658019 |
import os
from gym import spaces
import numpy as np
import ray
from ray.rllib.agents.dqn import DQNTrainer
from ray.rllib.env.external_env import ExternalEnv
from ray.rllib.utils.policy_server import PolicyServer
from ray.tune.logger import pretty_print
from ray.tune.registry import register_env
SERVER_ADDRESS = "lo... | true | true |
f72d5366075c57378dcb950830cdf43d266193ee | 5,681 | py | Python | neurst/data/datasets/parallel_text_dataset.py | emailandxu/neurst | 235bddfc93b7784df01eddccec6791e1281651cf | [
"Apache-2.0"
] | null | null | null | neurst/data/datasets/parallel_text_dataset.py | emailandxu/neurst | 235bddfc93b7784df01eddccec6791e1281651cf | [
"Apache-2.0"
] | null | null | null | neurst/data/datasets/parallel_text_dataset.py | emailandxu/neurst | 235bddfc93b7784df01eddccec6791e1281651cf | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 ByteDance Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 35.285714 | 88 | 0.620313 | from abc import ABCMeta, abstractmethod
import six
import tensorflow as tf
from absl import logging
from neurst.data.datasets import register_dataset
from neurst.data.datasets.dataset import TFRecordDataset
from neurst.data.datasets.text_gen_dataset import TextGenDataset
from neurst.utils.compat import DataStatus
fro... | true | true |
f72d53847ce5a7ccd7789359de36e77c4eea6916 | 6,583 | py | Python | tests/providers/airbyte/hooks/test_airbyte.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | tests/providers/airbyte/hooks/test_airbyte.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | tests/providers/airbyte/hooks/test_airbyte.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.664557 | 109 | 0.705453 | import unittest
from unittest import mock
import pytest
import requests_mock
from airflow.exceptions import AirflowException
from airflow.models import Connection
from airflow.providers.airbyte.hooks.airbyte import AirbyteHook
from airflow.utils import db
class TestAirbyteHook(unittest.TestCase):
airbyte_conn_... | true | true |
f72d5492165937b6bde071a810e477e645ff83f7 | 68,601 | py | Python | scripts/sampleOutputs/bkup/cmp_bwavesgcccactusADMgromacs/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | scripts/sampleOutputs/bkup/cmp_bwavesgcccactusADMgromacs/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | scripts/sampleOutputs/bkup/cmp_bwavesgcccactusADMgromacs/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | 75.055799 | 124 | 0.682045 | power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | true | true |
f72d54cc192e42e146e0bea3d8aa115af59dd401 | 128,875 | py | Python | FWCore/ParameterSet/python/SequenceTypes.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | FWCore/ParameterSet/python/SequenceTypes.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | FWCore/ParameterSet/python/SequenceTypes.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import sys
from builtins import range
from .Mixins import _ConfigureComponent, PrintOptions
from .Mixins import _Labelable, _Unlabelable
from .Mixins import _ValidatingParameterListBase
from .ExceptionHandling import *
from .OrderedSet import OrderedSet
class _HardDependency(obj... | 43.642059 | 250 | 0.587189 | from __future__ import absolute_import
import sys
from builtins import range
from .Mixins import _ConfigureComponent, PrintOptions
from .Mixins import _Labelable, _Unlabelable
from .Mixins import _ValidatingParameterListBase
from .ExceptionHandling import *
from .OrderedSet import OrderedSet
class _HardDependency(obj... | true | true |
f72d55398fb004b998a56639bb271afa5e8e1c9c | 167 | py | Python | eswar4.py | Eswar12345/training-kit | 294e622eed175144faead24206d4241e25fbda35 | [
"CC-BY-4.0"
] | null | null | null | eswar4.py | Eswar12345/training-kit | 294e622eed175144faead24206d4241e25fbda35 | [
"CC-BY-4.0"
] | null | null | null | eswar4.py | Eswar12345/training-kit | 294e622eed175144faead24206d4241e25fbda35 | [
"CC-BY-4.0"
] | null | null | null | n=int(input("enter the size"))
a=[]
for i in range(n):
b=input("enter")
a.append(b)
for i in range(n):
count=a.count(i)
if(count==1):
print(i)
| 16.7 | 30 | 0.54491 | n=int(input("enter the size"))
a=[]
for i in range(n):
b=input("enter")
a.append(b)
for i in range(n):
count=a.count(i)
if(count==1):
print(i)
| true | true |
f72d562143f7bbb140a16c6d0887b2f083f9e29c | 342 | py | Python | utility.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | 26 | 2018-12-30T20:32:45.000Z | 2022-03-15T06:11:40.000Z | utility.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | 20 | 2018-08-29T10:34:48.000Z | 2022-03-11T23:16:24.000Z | utility.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | 13 | 2019-05-11T01:59:58.000Z | 2022-03-15T14:12:40.000Z | #!/usr/bin/python
# -*- encoding=utf-8 -*-
# author: Ian
# e-mail: stmayue@gmail.com
# description:
def list_to_dict(in_list):
return dict((i, in_list[i]) for i in range(0, len(in_list)))
def exchange_key_value(in_dict):
return dict((in_dict[i], i) for i in in_dict)
def main():
pass
if __name__ == ... | 16.285714 | 64 | 0.643275 |
def list_to_dict(in_list):
return dict((i, in_list[i]) for i in range(0, len(in_list)))
def exchange_key_value(in_dict):
return dict((in_dict[i], i) for i in in_dict)
def main():
pass
if __name__ == '__main__':
main() | true | true |
f72d5641bc821b12e049ec960ca9abbb3155f191 | 18,824 | py | Python | ddf_utils/model/package.py | semio/ddf_utils | e10c4cb6dc7722415a5863579a552cc7b7e3668d | [
"MIT"
] | 2 | 2016-11-23T12:28:15.000Z | 2019-03-04T16:06:25.000Z | ddf_utils/model/package.py | semio/ddf_utils | e10c4cb6dc7722415a5863579a552cc7b7e3668d | [
"MIT"
] | 124 | 2016-07-14T13:39:41.000Z | 2021-12-24T01:45:23.000Z | ddf_utils/model/package.py | semio/ddf_utils | e10c4cb6dc7722415a5863579a552cc7b7e3668d | [
"MIT"
] | 1 | 2016-11-30T23:42:56.000Z | 2016-11-30T23:42:56.000Z | # -*- coding: utf-8 -*-
"""datapackage model"""
import os.path as osp
from typing import List, Tuple, Dict, Union, Callable
import attr
import json
from itertools import product
from collections import OrderedDict
from tqdm import tqdm
import pandas as pd
from .ddf import DDF, Concept, EntityDomain, Entity, DaskDat... | 39.216667 | 132 | 0.565555 |
import os.path as osp
from typing import List, Tuple, Dict, Union, Callable
import attr
import json
from itertools import product
from collections import OrderedDict
from tqdm import tqdm
import pandas as pd
from .ddf import DDF, Concept, EntityDomain, Entity, DaskDataPoint, Synonym
from .utils import absolute_path... | true | true |
f72d5748bd487ceab701dc4cc272207445379be2 | 2,211 | py | Python | app/views/main.py | ybqdren/BygjRace-DataShowChart | eb903aaf0dd8682e1c12eb182e9f0b7f4eef2daf | [
"Apache-2.0"
] | null | null | null | app/views/main.py | ybqdren/BygjRace-DataShowChart | eb903aaf0dd8682e1c12eb182e9f0b7f4eef2daf | [
"Apache-2.0"
] | null | null | null | app/views/main.py | ybqdren/BygjRace-DataShowChart | eb903aaf0dd8682e1c12eb182e9f0b7f4eef2daf | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
#@Time : 2020/9/20 14:48
#@Author: 赵雯
#@File : main.py
from flask import Blueprint
from flask import render_template
from app.models import Tbl_Video_Game_Sales
from app import create_app
from app.extensions import db
# 创建蓝图
main_print = Blueprint('main_print',__name__)
# 图像切换
@main_print.rout... | 34.015385 | 146 | 0.736318 |
from flask import Blueprint
from flask import render_template
from app.models import Tbl_Video_Game_Sales
from app import create_app
from app.extensions import db
main_print = Blueprint('main_print',__name__)
@main_print.route('/charts/changeView')
def change_View():
game_sale = Tbl_Video_Game_Sales.query.order_... | true | true |
f72d577bcfe3d24380f86ed18bbd6aa06bd74d8b | 457 | py | Python | app/migrations/0011_signature_status.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | 1 | 2020-09-19T21:56:40.000Z | 2020-09-19T21:56:40.000Z | app/migrations/0011_signature_status.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | null | null | null | app/migrations/0011_signature_status.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | 5 | 2020-09-18T18:53:03.000Z | 2020-10-21T14:42:00.000Z | # Generated by Django 3.1 on 2020-09-25 16:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0010_auto_20200923_0246'),
]
operations = [
migrations.AddField(
model_name='signature',
name='status',
... | 22.85 | 90 | 0.608315 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0010_auto_20200923_0246'),
]
operations = [
migrations.AddField(
model_name='signature',
name='status',
field=models.CharField(default='sdsd', ma... | true | true |
f72d57b4c59f86945e4272585aaa430b4ea5075e | 1,343 | py | Python | pymata-aio/blink.py | hevangel/arduino_examples | 06c717ff87eab1b0fb0a7f17bf3a1e824fe59b6a | [
"MIT"
] | null | null | null | pymata-aio/blink.py | hevangel/arduino_examples | 06c717ff87eab1b0fb0a7f17bf3a1e824fe59b6a | [
"MIT"
] | null | null | null | pymata-aio/blink.py | hevangel/arduino_examples | 06c717ff87eab1b0fb0a7f17bf3a1e824fe59b6a | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation... | 23.155172 | 73 | 0.689501 |
from pymata_aio.pymata3 import PyMata3
from pymata_aio.constants import Constants
BOARD_LED = 13
board = PyMata3()
def setup():
board.set_pin_mode(BOARD_LED, Constants.OUTPUT)
def loop():
print("LED On")
board.digital_write(BOARD_LED, 1)
board.sleep(1.0)
print("LED Off")
board.digital_... | true | true |
f72d57dd8a2accb925b58023a61affc55a11c045 | 946 | py | Python | insta/forms.py | WaMungai/InstaClone | 68279dfbf93801c1b5355b91c9e03e3b469cd6d0 | [
"Unlicense"
] | null | null | null | insta/forms.py | WaMungai/InstaClone | 68279dfbf93801c1b5355b91c9e03e3b469cd6d0 | [
"Unlicense"
] | 5 | 2021-06-08T20:55:05.000Z | 2022-03-12T00:14:51.000Z | insta/forms.py | WaMungai/InstaClone | 68279dfbf93801c1b5355b91c9e03e3b469cd6d0 | [
"Unlicense"
] | null | null | null | from django import forms
from .models import Image,Profile,Comments
class NewsLetterForm(forms.Form):
your_name=forms.CharField(label='First Name',max_length=30)
email=forms.EmailField(label='Email')
class NewImageForm(forms.ModelForm):
class Meta:
model= Image
exclude =['editor','pub_... | 27.028571 | 79 | 0.615222 | from django import forms
from .models import Image,Profile,Comments
class NewsLetterForm(forms.Form):
your_name=forms.CharField(label='First Name',max_length=30)
email=forms.EmailField(label='Email')
class NewImageForm(forms.ModelForm):
class Meta:
model= Image
exclude =['editor','pub_... | true | true |
f72d5872f699dd0d0180714ec301adb7cf7026cd | 2,963 | py | Python | fid-judaica/compactmemory/Scripts/CM-uni-name-filter.py | judaicalink/judaicalink-generators | 845dbd6886fa82ec45adf16ba08fad9d26169419 | [
"MIT"
] | 1 | 2020-09-20T17:00:05.000Z | 2020-09-20T17:00:05.000Z | fid-judaica/compactmemory/Scripts/CM-uni-name-filter.py | wisslab/judaicalink-generators | 845dbd6886fa82ec45adf16ba08fad9d26169419 | [
"MIT"
] | null | null | null | fid-judaica/compactmemory/Scripts/CM-uni-name-filter.py | wisslab/judaicalink-generators | 845dbd6886fa82ec45adf16ba08fad9d26169419 | [
"MIT"
] | null | null | null | #Maral Dadvar
#09/01/2019
#This script filters the names with initialls.
import unicodedata
import os , glob
import rdflib
from rdflib import Namespace, URIRef, Graph , Literal , OWL, RDFS , RDF
from SPARQLWrapper import SPARQLWrapper2, XML , JSON , TURTLE
import re
import pprint
os.chdir('C:\\Users\\Maral\\Deskto... | 29.929293 | 92 | 0.616605 |
import unicodedata
import os , glob
import rdflib
from rdflib import Namespace, URIRef, Graph , Literal , OWL, RDFS , RDF
from SPARQLWrapper import SPARQLWrapper2, XML , JSON , TURTLE
import re
import pprint
os.chdir('C:\\Users\\Maral\\Desktop')
graphout = Graph()
foaf = Namespace("http://xmlns.com/foaf/0.1/")
r... | true | true |
f72d59225445029c6a86a5bdbd4987fd50a20da0 | 106 | py | Python | code/spavanac.py | kkirigaya/Kattis | 29b7180aef70f51ea5b4d064204f70fc6d29d312 | [
"MIT"
] | 1 | 2021-06-05T20:52:43.000Z | 2021-06-05T20:52:43.000Z | code/spavanac.py | kkirigaya/Kattis | 29b7180aef70f51ea5b4d064204f70fc6d29d312 | [
"MIT"
] | null | null | null | code/spavanac.py | kkirigaya/Kattis | 29b7180aef70f51ea5b4d064204f70fc6d29d312 | [
"MIT"
] | null | null | null | h,m = map(int, input().split())
mins = (24+h) * 60 + m
mins -= 45
mins %= 24*60
print(mins//60, mins%60)
| 15.142857 | 31 | 0.556604 | h,m = map(int, input().split())
mins = (24+h) * 60 + m
mins -= 45
mins %= 24*60
print(mins//60, mins%60)
| true | true |
f72d5cc69110919bd4a78eb7980484c39ec6a0ac | 2,256 | py | Python | Neural Networks and Deep Learning/Week 3/Planar data classification with one hidden layer/planar_utils.py | 837278709/Deep-Learning-Coursera-1 | 2498a90d3f61ec0876752205066ec95323f83161 | [
"MIT"
] | 2 | 2020-05-08T21:18:08.000Z | 2020-07-18T22:13:22.000Z | Neural Networks and Deep Learning/Week 3/Planar data classification with one hidden layer/planar_utils.py | 837278709/Deep-Learning-Coursera-1 | 2498a90d3f61ec0876752205066ec95323f83161 | [
"MIT"
] | null | null | null | Neural Networks and Deep Learning/Week 3/Planar data classification with one hidden layer/planar_utils.py | 837278709/Deep-Learning-Coursera-1 | 2498a90d3f61ec0876752205066ec95323f83161 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
def plot_decision_boundary(model, X, y):
# Set min and max values and give it some padding
x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1
y_min, y_max = X[1, :].min() - 1, X[1, :].max(... | 34.181818 | 158 | 0.626773 | import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
def plot_decision_boundary(model, X, y):
x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1
y_min, y_max = X[1, :].min() - 1, X[1, :].max() + 1
h = 0.01
xx, yy = np.meshgrid(np... | true | true |
f72d5e0130a982d18538ffc607524187f38dc74a | 71,614 | py | Python | PV_ICE/main.py | NREL/PV-DEMICE | 6e2938950ff10c37f176f46aeb76c78de609f535 | [
"BSD-3-Clause"
] | 3 | 2020-05-11T15:19:47.000Z | 2020-09-10T16:53:10.000Z | PV_ICE/main.py | NREL/PV_DEMICE | 6e2938950ff10c37f176f46aeb76c78de609f535 | [
"BSD-3-Clause"
] | 2 | 2020-04-09T17:41:54.000Z | 2020-07-20T17:25:26.000Z | PV_ICE/main.py | NREL/PV_DEMICE | 6e2938950ff10c37f176f46aeb76c78de609f535 | [
"BSD-3-Clause"
] | 1 | 2020-04-09T17:36:28.000Z | 2020-04-09T17:36:28.000Z | # -*- coding: utf-8 -*-
"""
Main.py contains the functions to calculate the different quantities of materials
in each step of the process. Reffer to the diagram on Package-Overview for the
steps considered.
Support functions include Weibull functions for reliability and failure; also,
functions to modify baseline v... | 45.182334 | 184 | 0.549725 |
import numpy as np
import pandas as pd
import datetime
import os
import matplotlib.pyplot as plt
def read_baseline_material(scenario, material='None', file=None):
if file is None:
try:
file = _interactive_load('Select baseline file')
except:
raise Exception('Interactiv... | true | true |
f72d609c4df4a3f3c318b99781086c3d6d4d85e2 | 4,134 | py | Python | bot/helper/mirror_utils/download_utils/aria2_download.py | styloxyash1/mybot | 285efe23d8fa429738ff2198da684d846fe2bf6f | [
"MIT"
] | null | null | null | bot/helper/mirror_utils/download_utils/aria2_download.py | styloxyash1/mybot | 285efe23d8fa429738ff2198da684d846fe2bf6f | [
"MIT"
] | null | null | null | bot/helper/mirror_utils/download_utils/aria2_download.py | styloxyash1/mybot | 285efe23d8fa429738ff2198da684d846fe2bf6f | [
"MIT"
] | null | null | null | from bot import aria2, download_dict_lock, STOP_DUPLICATE_MIRROR
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
from bot.helper.ext_utils.bot_utils import *
from .download_helper import DownloadHelper
from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadS... | 43.515789 | 178 | 0.631834 | from bot import aria2, download_dict_lock, STOP_DUPLICATE_MIRROR
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
from bot.helper.ext_utils.bot_utils import *
from .download_helper import DownloadHelper
from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadS... | true | true |
f72d61d379f5848b7d7637715d23e9aa174497d6 | 4,399 | py | Python | djangocms_installer/config/ini.py | michalnik/djangocms-installer | 5f825c02b1c324a2c9c3d0662913a3a2fdf798dd | [
"BSD-3-Clause"
] | 145 | 2015-01-17T12:03:48.000Z | 2022-03-09T16:54:27.000Z | djangocms_installer/config/ini.py | michalnik/djangocms-installer | 5f825c02b1c324a2c9c3d0662913a3a2fdf798dd | [
"BSD-3-Clause"
] | 204 | 2015-01-04T23:19:03.000Z | 2022-03-23T12:28:14.000Z | djangocms_installer/config/ini.py | michalnik/djangocms-installer | 5f825c02b1c324a2c9c3d0662913a3a2fdf798dd | [
"BSD-3-Clause"
] | 88 | 2015-01-11T09:41:28.000Z | 2022-03-05T15:29:47.000Z | import sys
from configparser import ConfigParser
from .data import CMS_VERSION_MATRIX, DJANGO_VERSION_MATRIX
SECTION = "djangocms_installer"
def parse_config_file(parser, stdin_args):
"""Parse config file.
Returns a list of additional args.
"""
config_args = []
# Temporary switch required args... | 35.475806 | 103 | 0.597409 | import sys
from configparser import ConfigParser
from .data import CMS_VERSION_MATRIX, DJANGO_VERSION_MATRIX
SECTION = "djangocms_installer"
def parse_config_file(parser, stdin_args):
config_args = []
required_args = []
for action in parser._actions:
if action.required:
required... | true | true |
f72d627417aaa695ea5bcada408ff82f6f850efa | 11,113 | py | Python | trajectory_generator.py | keshaviyengar/rl-baselines-zoo | 6e39f5c7c6c2d30873297308ed064551bffaa52d | [
"MIT"
] | null | null | null | trajectory_generator.py | keshaviyengar/rl-baselines-zoo | 6e39f5c7c6c2d30873297308ed064551bffaa52d | [
"MIT"
] | null | null | null | trajectory_generator.py | keshaviyengar/rl-baselines-zoo | 6e39f5c7c6c2d30873297308ed064551bffaa52d | [
"MIT"
] | null | null | null | import rospy
from geometry_msgs.msg import Pose, Point
from std_msgs.msg import Bool
import numpy as np
import os
# This script creates a square trajectory for a robot to follow.
# Will output errors as well.
class CircleTrajectory(object):
def __init__(self, x_offset, y_offset, z_height, radius, theta_step):
... | 41.778195 | 114 | 0.602268 | import rospy
from geometry_msgs.msg import Pose, Point
from std_msgs.msg import Bool
import numpy as np
import os
class CircleTrajectory(object):
def __init__(self, x_offset, y_offset, z_height, radius, theta_step):
self.trajectory_pub = rospy.Publisher("desired_goal", Pose, queue_size=10)
self.t... | true | true |
f72d6285375c24c78245dbcf07e15d8c189eb8b6 | 59 | py | Python | app/repository/services.py | maestro-server/data-app | cde6479cc84fe410220b34742772d5017571e3d3 | [
"Apache-2.0"
] | null | null | null | app/repository/services.py | maestro-server/data-app | cde6479cc84fe410220b34742772d5017571e3d3 | [
"Apache-2.0"
] | 1 | 2019-11-21T17:06:31.000Z | 2019-11-21T17:06:31.000Z | app/repository/services.py | maestro-server/data-app | cde6479cc84fe410220b34742772d5017571e3d3 | [
"Apache-2.0"
] | null | null | null | from .model import Model
class Services(Model):
pass
| 9.833333 | 24 | 0.711864 | from .model import Model
class Services(Model):
pass
| true | true |
f72d629fff0e039793bbb803e5a71873269a33db | 2,269 | py | Python | shadowray/core/server.py | shunf4/Shadowray | 3ec2e69a9b079e051983f7d84252ba787ce933a2 | [
"MIT"
] | 30 | 2019-02-25T23:20:20.000Z | 2021-06-29T02:31:39.000Z | shadowray/core/server.py | shunf4/Shadowray | 3ec2e69a9b079e051983f7d84252ba787ce933a2 | [
"MIT"
] | 4 | 2019-06-15T02:15:37.000Z | 2020-02-19T08:05:43.000Z | shadowray/core/server.py | shunf4/Shadowray | 3ec2e69a9b079e051983f7d84252ba787ce933a2 | [
"MIT"
] | 7 | 2019-06-14T13:04:27.000Z | 2021-06-11T02:28:52.000Z | import json
from shadowray.config.v2ray import SERVER_FILE
from shadowray.config.v2ray import SERVER_KEY_FROM_SUBSCRIBE, SERVER_KEY_FROM_ORIGINAL
class Server:
def __init__(self, filename=None):
self.__servers = json.loads('{"servers_subscribe": [] ,"servers_original": []}')
self.__filename = SER... | 30.253333 | 108 | 0.629352 | import json
from shadowray.config.v2ray import SERVER_FILE
from shadowray.config.v2ray import SERVER_KEY_FROM_SUBSCRIBE, SERVER_KEY_FROM_ORIGINAL
class Server:
def __init__(self, filename=None):
self.__servers = json.loads('{"servers_subscribe": [] ,"servers_original": []}')
self.__filename = SER... | true | true |
f72d6339cd3ded535fd21c00b1fa0263e5217447 | 15,849 | py | Python | napari/layers/surface/surface.py | truatpasteurdotfr/napari | 06ba5f3ebc964d83169f786f734b1b1c9609592e | [
"BSD-3-Clause"
] | 1 | 2021-12-14T14:07:40.000Z | 2021-12-14T14:07:40.000Z | napari/layers/surface/surface.py | maweigert/napari | 48cdf4d1c4bcf6f76603e90b1c0c7498e2aba6c0 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/surface/surface.py | maweigert/napari | 48cdf4d1c4bcf6f76603e90b1c0c7498e2aba6c0 | [
"BSD-3-Clause"
] | 1 | 2019-01-12T21:04:14.000Z | 2019-01-12T21:04:14.000Z | import warnings
import numpy as np
from ...utils.colormaps import AVAILABLE_COLORMAPS
from ...utils.events import Event
from ...utils.translations import trans
from ..base import Layer
from ..intensity_mixin import IntensityVisualizationMixin
from ..utils.layer_utils import calc_data_range
from ._surface_constants im... | 35.141907 | 199 | 0.600921 | import warnings
import numpy as np
from ...utils.colormaps import AVAILABLE_COLORMAPS
from ...utils.events import Event
from ...utils.translations import trans
from ..base import Layer
from ..intensity_mixin import IntensityVisualizationMixin
from ..utils.layer_utils import calc_data_range
from ._surface_constants im... | true | true |
f72d638bd51100a4bc9f891fd1b36e89b5cb1ce3 | 596 | py | Python | env/lib/python3.8/site-packages/plotly/validators/funnel/textfont/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/funnel/textfont/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/funnel/textfont/_family.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="family", parent_name="funnel.textfont", **kwargs):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 37.25 | 86 | 0.630872 | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="family", parent_name="funnel.textfont", **kwargs):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f72d67de22841e398e607b96810cbb106f887d88 | 16,892 | py | Python | nni/compression/pytorch/utils/mask_conflict.py | ggzhang0071/nni | f4145e62d89c3ca383cf00f2de5dfd2d1025ad92 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | nni/compression/pytorch/utils/mask_conflict.py | soma2000-lang/nni | eaad98528c7aa714c9848800d607d6aa3bdd531d | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | nni/compression/pytorch/utils/mask_conflict.py | soma2000-lang/nni | eaad98528c7aa714c9848800d607d6aa3bdd531d | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import logging
import torch
import numpy as np
from .shape_dependency import ChannelDependency, GroupDependency, InputChannelDependency
from .utils import get_module_by_name
# logging.basicConfig(level = logging.DEBUG)
_logger = logging.... | 42.33584 | 137 | 0.572401 | import os
import logging
import torch
import numpy as np
from .shape_dependency import ChannelDependency, GroupDependency, InputChannelDependency
from .utils import get_module_by_name
_logger = logging.getLogger('FixMaskConflict')
def fix_mask_conflict(masks, model, dummy_input, traced=None):
if isinstance(masks,... | true | true |
f72d67e6523be41eb111c7190580bae833cc635f | 100 | py | Python | Week 1/grok/samples/1b/19.view dimensions of fits images.py | anandprabhakar0507/Assignments-Data-Driven-Astronomy-from-University-of-sydney-on-coursera- | 58fab1c413d7ad5693b1d63f14be05b0f5ec448c | [
"MIT"
] | 4 | 2021-07-02T02:57:31.000Z | 2022-02-01T17:31:14.000Z | Week 1/grok/samples/1b/19.view dimensions of fits images.py | anandprabhakar0507/Assignments-Data-Driven-Astronomy-from-University-of-sydney-on-coursera- | 58fab1c413d7ad5693b1d63f14be05b0f5ec448c | [
"MIT"
] | null | null | null | Week 1/grok/samples/1b/19.view dimensions of fits images.py | anandprabhakar0507/Assignments-Data-Driven-Astronomy-from-University-of-sydney-on-coursera- | 58fab1c413d7ad5693b1d63f14be05b0f5ec448c | [
"MIT"
] | 3 | 2021-07-12T21:54:43.000Z | 2022-02-01T17:31:42.000Z | from astropy.io import fits
a = fits.open('image0.fits')
image = a[0].data
print(image.shape) | 16.666667 | 29 | 0.68 | from astropy.io import fits
a = fits.open('image0.fits')
image = a[0].data
print(image.shape) | true | true |
f72d6827c967a7c37c9189b3d2a2e0b6721fb490 | 228 | py | Python | hknweb/exams/admin.py | yuji3w/hknweb | 0df5369da28f46dc9016da97652cb6b8e2b7f3e6 | [
"MIT"
] | 3 | 2019-04-22T21:51:07.000Z | 2019-12-16T21:54:00.000Z | hknweb/exams/admin.py | yuji3w/hknweb | 0df5369da28f46dc9016da97652cb6b8e2b7f3e6 | [
"MIT"
] | null | null | null | hknweb/exams/admin.py | yuji3w/hknweb | 0df5369da28f46dc9016da97652cb6b8e2b7f3e6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Course, CourseSemester, Department, Instructor
admin.site.register(Course)
admin.site.register(CourseSemester)
admin.site.register(Department)
admin.site.register(Instructor) | 32.571429 | 66 | 0.842105 | from django.contrib import admin
from .models import Course, CourseSemester, Department, Instructor
admin.site.register(Course)
admin.site.register(CourseSemester)
admin.site.register(Department)
admin.site.register(Instructor) | true | true |
f72d686e003d9fdaeb69d3bfc5e9e05d5aff6ab6 | 260 | py | Python | scripts/basins/create_ptshp.py | jrising/research-common | 2b930d29fa0b16b3b08b33b7d8fffa583ccde94f | [
"MIT"
] | null | null | null | scripts/basins/create_ptshp.py | jrising/research-common | 2b930d29fa0b16b3b08b33b7d8fffa583ccde94f | [
"MIT"
] | null | null | null | scripts/basins/create_ptshp.py | jrising/research-common | 2b930d29fa0b16b3b08b33b7d8fffa583ccde94f | [
"MIT"
] | 3 | 2016-02-09T00:59:01.000Z | 2018-03-31T10:17:49.000Z | import sys
import shapefile
longitude = float(sys.argv[1])
latitude = float(sys.argv[2])
outpath = sys.argv[3]
writer = shapefile.Writer(shapefile.POINT)
writer.field('label')
writer.point(longitude, latitude)
writer.record('singleton')
writer.save(outpath)
| 20 | 42 | 0.765385 | import sys
import shapefile
longitude = float(sys.argv[1])
latitude = float(sys.argv[2])
outpath = sys.argv[3]
writer = shapefile.Writer(shapefile.POINT)
writer.field('label')
writer.point(longitude, latitude)
writer.record('singleton')
writer.save(outpath)
| true | true |
f72d68fb62a2806074aca8a22832fda252b941ff | 12,657 | py | Python | seedminer/seedminer_launcher3.py | Marenthyu/seedminer | c46eb002e34cce4fe847d5b5ea59955ec9a69626 | [
"MIT"
] | null | null | null | seedminer/seedminer_launcher3.py | Marenthyu/seedminer | c46eb002e34cce4fe847d5b5ea59955ec9a69626 | [
"MIT"
] | null | null | null | seedminer/seedminer_launcher3.py | Marenthyu/seedminer | c46eb002e34cce4fe847d5b5ea59955ec9a69626 | [
"MIT"
] | null | null | null | import os,sys,struct,glob
import urllib.request
from binascii import hexlify, unhexlify
#don't change this mid brute force - can be different amount multiple computers - powers of two recommended for even distribution of workload 1 2 4 8 etc.
process_count=4
offset_override=0 #for gpu options, this allows st... | 31.174877 | 155 | 0.56372 | import os,sys,struct,glob
import urllib.request
from binascii import hexlify, unhexlify
process_count=4
offset_override=0 #for gpu options, this allows starting brute-force at a user-defined offset
#--------------------------------------------------------------------------------------------------------------... | true | true |
f72d6933dae80411f980cfd73104cb634eba5baa | 19,394 | py | Python | tests/test_FluxCSVParser.py | influxdata/influxdb-client-python | bb378af3a56470ba74daeeb51f77b0d2c4a61350 | [
"MIT"
] | 380 | 2019-09-19T20:20:10.000Z | 2022-03-31T12:59:33.000Z | tests/test_FluxCSVParser.py | influxdata/influxdb-client-python | bb378af3a56470ba74daeeb51f77b0d2c4a61350 | [
"MIT"
] | 362 | 2019-09-16T11:53:29.000Z | 2022-03-29T03:11:59.000Z | tests/test_FluxCSVParser.py | influxdata/influxdb-client-python | bb378af3a56470ba74daeeb51f77b0d2c4a61350 | [
"MIT"
] | 130 | 2019-09-20T08:02:35.000Z | 2022-03-30T16:44:45.000Z | import math
import unittest
from io import BytesIO
from urllib3 import HTTPResponse
from influxdb_client.client.flux_csv_parser import FluxCsvParser, FluxSerializationMode, FluxQueryException
from influxdb_client.client.flux_table import FluxStructureEncoder
class FluxCsvParserTest(unittest.TestCase):
def test... | 77.576 | 149 | 0.678973 | import math
import unittest
from io import BytesIO
from urllib3 import HTTPResponse
from influxdb_client.client.flux_csv_parser import FluxCsvParser, FluxSerializationMode, FluxQueryException
from influxdb_client.client.flux_table import FluxStructureEncoder
class FluxCsvParserTest(unittest.TestCase):
def test... | true | true |
f72d6a033dce893b176c2539c0e154a035cb9415 | 1,437 | py | Python | RecoTracker/TkSeedGenerator/python/GlobalSeedsFromPairsWithVertices_cff.py | samarendran23/cmssw | 849dd9897db9b894ca83e1b630a3c1eecafd6097 | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | RecoTracker/TkSeedGenerator/python/GlobalSeedsFromPairsWithVertices_cff.py | samarendran23/cmssw | 849dd9897db9b894ca83e1b630a3c1eecafd6097 | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | RecoTracker/TkSeedGenerator/python/GlobalSeedsFromPairsWithVertices_cff.py | samarendran23/cmssw | 849dd9897db9b894ca83e1b630a3c1eecafd6097 | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
from RecoLocalTracker.SiStripRecHitConverter.StripCPEfromTrackAngle_cfi import *
from RecoLocalTracker.SiStripRecHitConverter.SiStripRecHitMatcher_cfi import *
from RecoLocalTracker.SiPixelRecHits.PixelCPEParmError_cfi import *
from RecoTracker.TransientTrackingRecHit.Transien... | 51.321429 | 149 | 0.857342 | import FWCore.ParameterSet.Config as cms
from RecoLocalTracker.SiStripRecHitConverter.StripCPEfromTrackAngle_cfi import *
from RecoLocalTracker.SiStripRecHitConverter.SiStripRecHitMatcher_cfi import *
from RecoLocalTracker.SiPixelRecHits.PixelCPEParmError_cfi import *
from RecoTracker.TransientTrackingRecHit.Transien... | true | true |
f72d6a6678fa943f663ba4e1f59271b649442a99 | 1,180 | py | Python | example/ssd/tools/visualize_net.py | axbaretto/mxnet | 5f593885356ff6d14f5519fa18e79b944beb51cd | [
"Apache-2.0"
] | 9 | 2017-07-13T03:12:24.000Z | 2021-11-10T16:15:27.000Z | example/ssd/tools/visualize_net.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 3 | 2017-07-10T21:49:18.000Z | 2017-07-12T22:40:06.000Z | example/ssd/tools/visualize_net.py | yanghaojin/BMXNet | 102f8d0ed59529bbd162c37bf07ae58ad6c4caa1 | [
"Apache-2.0"
] | 11 | 2018-02-27T15:32:09.000Z | 2021-04-21T08:48:17.000Z | from __future__ import print_function
import find_mxnet
import mxnet as mx
import argparse
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'symbol'))
import symbol_factory
parser = argparse.ArgumentParser(description='network visualization')
parser.add_argument('--network', type=str, defa... | 42.142857 | 102 | 0.701695 | from __future__ import print_function
import find_mxnet
import mxnet as mx
import argparse
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'symbol'))
import symbol_factory
parser = argparse.ArgumentParser(description='network visualization')
parser.add_argument('--network', type=str, defa... | true | true |
f72d6c4ce56c7ff17559ee79b46baa9dea887b9d | 1,154 | py | Python | Chapter 3/prototypes.py | alisx/lightdjango_practice | 9a0662a04b306e6f0e6accc3d0be08ea1f274a2a | [
"MIT"
] | 1 | 2019-11-24T13:49:02.000Z | 2019-11-24T13:49:02.000Z | Chapter 3/prototypes.py | alisx/lightdjango_practice | 9a0662a04b306e6f0e6accc3d0be08ea1f274a2a | [
"MIT"
] | null | null | null | Chapter 3/prototypes.py | alisx/lightdjango_practice | 9a0662a04b306e6f0e6accc3d0be08ea1f274a2a | [
"MIT"
] | 1 | 2018-10-11T05:39:42.000Z | 2018-10-11T05:39:42.000Z | import sys
import os
from django.conf import settings
DEBUG = os.environ.get('DEBUG', 'on') == 'on'
SECRET_KEY = os.environ.get('SECRET_KEY', 'a^hi#2sv)yy%v(6fhlv(j@-5e%+7h*d%#g%+ru(hv-7rj08r7n'),
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')
BASE_DIR = os.path.dirname(__file__)
settings.con... | 31.189189 | 96 | 0.67851 | import sys
import os
from django.conf import settings
DEBUG = os.environ.get('DEBUG', 'on') == 'on'
SECRET_KEY = os.environ.get('SECRET_KEY', 'a^hi#2sv)yy%v(6fhlv(j@-5e%+7h*d%#g%+ru(hv-7rj08r7n'),
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')
BASE_DIR = os.path.dirname(__file__)
settings.con... | true | true |
f72d6ce9565fd009da96d87e7bbeeb8795b95739 | 6,165 | py | Python | examples/resample_cube_to_sphere_with_depth.py | zuru/MappedConvolutions | 77dda41ac9e552fb77dc4494bd7e552c7c5b4e5d | [
"BSD-3-Clause"
] | null | null | null | examples/resample_cube_to_sphere_with_depth.py | zuru/MappedConvolutions | 77dda41ac9e552fb77dc4494bd7e552c7c5b4e5d | [
"BSD-3-Clause"
] | null | null | null | examples/resample_cube_to_sphere_with_depth.py | zuru/MappedConvolutions | 77dda41ac9e552fb77dc4494bd7e552c7c5b4e5d | [
"BSD-3-Clause"
] | null | null | null | # EXAMPLE: Resampling an cubemap to the vertices of an depth scaled icosphere
#
# This example shows how to resample a cubemap to the vertices of an
# icosphere. We then scale the vertices according to provided depth
# information, which reshapes the mesh to the indoor scene it captures. We
# then show how to render ba... | 40.827815 | 120 | 0.601946 |
import torch.nn.functional as F
from mapped_convolution.util import *
from skimage import io
order = 7 output_equirect_shape = (512, 1024) cuda = True
print('Generating icosphere')
icosphere = generate_icosphere(order)
print('Loading the cube map data')
tiff = io.MultiImage('examples/inputs/cubemap.tiff')
cub... | true | true |
f72d6d6bd8b769be90fb9315479c998445aa2960 | 2,872 | py | Python | cogs/utils/context.py | quiprr/gir | c6910f3f61d15d52da7b12e57d1d4f159c61689b | [
"MIT"
] | null | null | null | cogs/utils/context.py | quiprr/gir | c6910f3f61d15d52da7b12e57d1d4f159c61689b | [
"MIT"
] | null | null | null | cogs/utils/context.py | quiprr/gir | c6910f3f61d15d52da7b12e57d1d4f159c61689b | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import discord
import asyncio
from discord.ext import commands
import pytimeparse
class Context(commands.Context):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.settings = self.bot.settings
self.permissions = self.bot.settings.permis... | 38.810811 | 135 | 0.562674 | from datetime import datetime, timedelta
import discord
import asyncio
from discord.ext import commands
import pytimeparse
class Context(commands.Context):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.settings = self.bot.settings
self.permissions = self.bot.settings.permis... | true | true |
f72d6e2c4be3d01f2b6edef15a4ca63f9c34d66f | 6,328 | py | Python | clock-in.py | CaiChenshu/ZJU-Clock-In | 7501e73ce4ec052c44fdcef9d17df5d77d8f9e39 | [
"MIT"
] | 10 | 2021-09-30T05:17:20.000Z | 2022-02-18T06:33:42.000Z | clock-in.py | CaiChenshu/ZJU-Clock-In | 7501e73ce4ec052c44fdcef9d17df5d77d8f9e39 | [
"MIT"
] | null | null | null | clock-in.py | CaiChenshu/ZJU-Clock-In | 7501e73ce4ec052c44fdcef9d17df5d77d8f9e39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# 打卡脚修改自ZJU-nCov-Hitcarder的开源代码,感谢这位同学开源的代码
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import json
import re
import datetime
import time
import sys
class DaKa(object):
"""Hit card class
Attributes:
usernam... | 32.451282 | 233 | 0.59134 |
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import json
import re
import datetime
import time
import sys
class DaKa(object):
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ... | true | true |
f72d6f9e38555c7e0d5030a3358acec901499195 | 4,057 | py | Python | test/test_soil/test_load.py | voidpp/configpp | 6d395eef6a2279c8902c40c3f005d530674a6cba | [
"MIT"
] | null | null | null | test/test_soil/test_load.py | voidpp/configpp | 6d395eef6a2279c8902c40c3f005d530674a6cba | [
"MIT"
] | 6 | 2018-09-15T09:14:12.000Z | 2019-07-10T11:40:36.000Z | test/test_soil/test_load.py | voidpp/configpp | 6d395eef6a2279c8902c40c3f005d530674a6cba | [
"MIT"
] | null | null | null |
from configpp.soil import Config, Group, GroupMember, Transport, ClimberLocation
from voidpp_tools.mocks.file_system import FileSystem, mockfs
_data_filename = 'test1.json'
_data = {_data_filename: '{"a": 42}'}
def test_load_simple_not_found():
cfg = Config(_data_filename)
assert cfg.load() is False
@mock... | 25.515723 | 145 | 0.605866 |
from configpp.soil import Config, Group, GroupMember, Transport, ClimberLocation
from voidpp_tools.mocks.file_system import FileSystem, mockfs
_data_filename = 'test1.json'
_data = {_data_filename: '{"a": 42}'}
def test_load_simple_not_found():
cfg = Config(_data_filename)
assert cfg.load() is False
@mock... | true | true |
f72d708187d0aba7b19a053b52100f35313303b3 | 4,061 | py | Python | src/models/esvs.py | tomstark99/epic-kitchens-100-fyrp | cbc9e59569fb6110b900a51def1947b8a3c93699 | [
"Apache-2.0"
] | null | null | null | src/models/esvs.py | tomstark99/epic-kitchens-100-fyrp | cbc9e59569fb6110b900a51def1947b8a3c93699 | [
"Apache-2.0"
] | null | null | null | src/models/esvs.py | tomstark99/epic-kitchens-100-fyrp | cbc9e59569fb6110b900a51def1947b8a3c93699 | [
"Apache-2.0"
] | null | null | null | import torch as t
import torch.nn as nn
import torch.nn.functional as F
class MTRN(nn.Module):
def __init__(self, frame_count: int):
super().__init__()
self.frame_count = frame_count
self.fc1 = nn.Linear(256 * frame_count, 1024)
self.fc2 = nn.Linear(1024, 512)
... | 37.256881 | 118 | 0.592219 | import torch as t
import torch.nn as nn
import torch.nn.functional as F
class MTRN(nn.Module):
def __init__(self, frame_count: int):
super().__init__()
self.frame_count = frame_count
self.fc1 = nn.Linear(256 * frame_count, 1024)
self.fc2 = nn.Linear(1024, 512)
... | true | true |
f72d70e9b4cf7e6f3bcfcd54939051b3f505e477 | 800 | py | Python | sources_non_forked/ultisnips/pythonx/UltiSnips/snippet/definition/snipmate.py | khatchad/vimrc | e4fb69d3b7a8635f0881461853c9144763fae4c7 | [
"MIT"
] | 1 | 2017-04-24T04:07:48.000Z | 2017-04-24T04:07:48.000Z | sources_non_forked/ultisnips/pythonx/UltiSnips/snippet/definition/snipmate.py | RobotMa/vimrc | 5beda397d3c6f88b8542d843107a64c42bf13c93 | [
"MIT"
] | null | null | null | sources_non_forked/ultisnips/pythonx/UltiSnips/snippet/definition/snipmate.py | RobotMa/vimrc | 5beda397d3c6f88b8542d843107a64c42bf13c93 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
"""A snipMate snippet after parsing."""
from UltiSnips.snippet.definition.base import SnippetDefinition
from UltiSnips.snippet.parsing.snipmate import parse_and_instantiate
class SnipMateSnippetDefinition(SnippetDefinition):
"""See module doc."""
SNIPMATE_SNIPPET_P... | 25 | 69 | 0.6375 |
from UltiSnips.snippet.definition.base import SnippetDefinition
from UltiSnips.snippet.parsing.snipmate import parse_and_instantiate
class SnipMateSnippetDefinition(SnippetDefinition):
SNIPMATE_SNIPPET_PRIORITY = -1000
def __init__(self, trigger, value, description, location):
SnippetDefinition._... | true | true |
f72d711ff1d7d537e1b1c14304366b86f56d6150 | 2,176 | py | Python | src/data_generator/npz_generator.py | JaimeCernuda/dlio_benchmark | d9cfbf76b4c7fb0d48a0dd43b8d2f2ea6ba75949 | [
"MIT"
] | 10 | 2020-08-13T19:14:21.000Z | 2022-03-16T00:31:00.000Z | src/data_generator/npz_generator.py | JaimeCernuda/dlio_benchmark | d9cfbf76b4c7fb0d48a0dd43b8d2f2ea6ba75949 | [
"MIT"
] | null | null | null | src/data_generator/npz_generator.py | JaimeCernuda/dlio_benchmark | d9cfbf76b4c7fb0d48a0dd43b8d2f2ea6ba75949 | [
"MIT"
] | 3 | 2020-08-18T21:29:38.000Z | 2021-11-16T15:37:09.000Z | """
Copyright (C) 2020 Argonne, Hariharan Devarajan <hdevarajan@anl.gov>
This file is part of DLProfile
DLIO is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the published by the Free Softw... | 42.666667 | 117 | 0.664522 |
from src.common.enumerations import Compression
from src.data_generator.data_generator import DataGenerator
import numpy as np
from numpy import random
from src.utils.utility import progress
from shutil import copyfile
class NPZGenerator(DataGenerator):
def __init__(self):
super().__init__()
def ge... | true | true |
f72d736ad51216bde57d535049cd30a0302cf279 | 495 | py | Python | great_expectations/data_context/store/__init__.py | louispotok/great_expectations | b91a3ce10f771742f49ccad9c403bda03f318515 | [
"Apache-2.0"
] | null | null | null | great_expectations/data_context/store/__init__.py | louispotok/great_expectations | b91a3ce10f771742f49ccad9c403bda03f318515 | [
"Apache-2.0"
] | null | null | null | great_expectations/data_context/store/__init__.py | louispotok/great_expectations | b91a3ce10f771742f49ccad9c403bda03f318515 | [
"Apache-2.0"
] | null | null | null | from .store_backend import (
StoreBackend,
InMemoryStoreBackend,
# FilesystemStoreBackend,
FixedLengthTupleFilesystemStoreBackend,
FixedLengthTupleS3StoreBackend,
)
from .store import (
WriteOnlyStore,
ReadWriteStore,
BasicInMemoryStore,
)
from .namespaced_read_write_store import (
... | 20.625 | 43 | 0.769697 | from .store_backend import (
StoreBackend,
InMemoryStoreBackend,
FixedLengthTupleFilesystemStoreBackend,
FixedLengthTupleS3StoreBackend,
)
from .store import (
WriteOnlyStore,
ReadWriteStore,
BasicInMemoryStore,
)
from .namespaced_read_write_store import (
NamespacedReadWriteStore,... | true | true |
f72d738266321e8929e1cbbd0dc068b84fcc8a8d | 20,754 | py | Python | hydra/_internal/utils.py | evdcush/hydra | 5a34a01eaa0f0426d967e918a3ecd8ac6fcf9f47 | [
"MIT"
] | null | null | null | hydra/_internal/utils.py | evdcush/hydra | 5a34a01eaa0f0426d967e918a3ecd8ac6fcf9f47 | [
"MIT"
] | null | null | null | hydra/_internal/utils.py | evdcush/hydra | 5a34a01eaa0f0426d967e918a3ecd8ac6fcf9f47 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import copy
import inspect
import logging.config
import os
import sys
import warnings
from dataclasses import dataclass
from os.path import dirname, join, normpath, realpath
from traceback import print_exc, print_exception
from types... | 32.580848 | 103 | 0.597909 | import argparse
import copy
import inspect
import logging.config
import os
import sys
import warnings
from dataclasses import dataclass
from os.path import dirname, join, normpath, realpath
from traceback import print_exc, print_exception
from types import FrameType
from typing import Any, Callable, List, Optional, Seq... | true | true |
f72d75ce8a4a75b2b39f7b3d547dddf85ae41813 | 70,121 | py | Python | medcat/cat.py | CogStack/CAT | 5ac04d2676aede13f8e8d0ab408472c3c6d46a86 | [
"MIT"
] | 4 | 2019-03-18T11:54:58.000Z | 2019-06-26T02:53:38.000Z | medcat/cat.py | CogStack/CAT | 5ac04d2676aede13f8e8d0ab408472c3c6d46a86 | [
"MIT"
] | null | null | null | medcat/cat.py | CogStack/CAT | 5ac04d2676aede13f8e8d0ab408472c3c6d46a86 | [
"MIT"
] | null | null | null | import os
import shutil
import pickle
import traceback
import json
import logging
import math
import time
import psutil
from time import sleep
from copy import deepcopy
from multiprocess import Process, Manager, cpu_count
from multiprocess.queues import Queue
from multiprocess.synchronize import Lock
from typing import... | 46.778519 | 172 | 0.54878 | import os
import shutil
import pickle
import traceback
import json
import logging
import math
import time
import psutil
from time import sleep
from copy import deepcopy
from multiprocess import Process, Manager, cpu_count
from multiprocess.queues import Queue
from multiprocess.synchronize import Lock
from typing import... | true | true |
f72d76138982bf4b2da476be3f46ae6979a7c6a5 | 5,536 | py | Python | src/aks-preview/azext_aks_preview/_loadbalancer.py | ConnectionMaster/azure-cli-extensions | 08d184f4efeac397c1ffcd21a83d651f4fad2782 | [
"MIT"
] | 1 | 2021-02-03T23:06:06.000Z | 2021-02-03T23:06:06.000Z | src/aks-preview/azext_aks_preview/_loadbalancer.py | ConnectionMaster/azure-cli-extensions | 08d184f4efeac397c1ffcd21a83d651f4fad2782 | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/_loadbalancer.py | ConnectionMaster/azure-cli-extensions | 08d184f4efeac397c1ffcd21a83d651f4fad2782 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 50.788991 | 120 | 0.712247 |
from distutils.version import StrictVersion from knack.log import get_logger
from .vendored_sdks.azure_mgmt_preview_aks.v2020_12_01.models import ManagedClusterLoadBalancerProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_12_01.models import ManagedClusterLoadBalancerProfileManagedOutboundIPs
from .vendored_s... | true | true |
f72d76a79d946ab57c0ea4783590716defa93ac3 | 571 | py | Python | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/auto_rest_bool_test_service/operations/__init__.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 3 | 2018-03-20T22:36:32.000Z | 2021-07-15T02:36:51.000Z | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/auto_rest_bool_test_service/operations/__init__.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | null | null | null | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyBoolean/auto_rest_bool_test_service/operations/__init__.py | ljhljh235/AutoRest | b9ab4000e9b93d16925db84d08bafc225b098f8e | [
"MIT"
] | 1 | 2019-07-20T12:20:03.000Z | 2019-07-20T12:20:03.000Z | # 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 ... | 33.588235 | 76 | 0.563923 |
from .bool_model_operations import BoolModelOperations
__all__ = [
'BoolModelOperations',
]
| true | true |
f72d774084f94d2b1be0bd5b02c8349dacbc2579 | 2,049 | py | Python | filters/parse_interface.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2016-01-29T18:05:29.000Z | 2021-10-06T04:21:55.000Z | filters/parse_interface.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 9 | 2015-04-06T19:03:32.000Z | 2019-05-28T13:34:55.000Z | filters/parse_interface.py | adblockplus/web.adblockplus.org | c2c570ce4f4296afc3577afe233c6b23b128f206 | [
"MIT"
] | 18 | 2015-04-06T17:42:31.000Z | 2021-10-06T04:26:29.000Z |
import re
import warnings
TYPE_REGEXP = r"(?:arrayof\s+)?\w+"
def parse_interface(interface_items):
parsed = []
for key, value in interface_items.iteritems():
if "(" in key:
# Item is a method
match = re.match(r"^\s*(%s)\s+(\S+)\s*\(\s*([^\)]*)\s*\)\s*$" % TYPE_RE... | 38.660377 | 94 | 0.455344 |
import re
import warnings
TYPE_REGEXP = r"(?:arrayof\s+)?\w+"
def parse_interface(interface_items):
parsed = []
for key, value in interface_items.iteritems():
if "(" in key:
match = re.match(r"^\s*(%s)\s+(\S+)\s*\(\s*([^\)]*)\s*\)\s*$" % TYPE_REGEXP, key)
... | true | true |
f72d78d5dc3108cc117be1ea0357004699e0b64f | 2,137 | py | Python | rlberry/utils/torch.py | akrouriad/rlberry | dde4e2cbafca05fdef1df07646bb6368059eeadf | [
"MIT"
] | null | null | null | rlberry/utils/torch.py | akrouriad/rlberry | dde4e2cbafca05fdef1df07646bb6368059eeadf | [
"MIT"
] | null | null | null | rlberry/utils/torch.py | akrouriad/rlberry | dde4e2cbafca05fdef1df07646bb6368059eeadf | [
"MIT"
] | null | null | null | import os
import re
import shutil
from subprocess import check_output, run, PIPE
import numpy as np
import torch
import logging
logger = logging.getLogger(__name__)
def get_gpu_memory_map():
result = check_output(
["nvidia-smi", "--query-gpu=memory.used", "--format=csv,nounits,noheader"]
)
return... | 28.878378 | 101 | 0.617688 | import os
import re
import shutil
from subprocess import check_output, run, PIPE
import numpy as np
import torch
import logging
logger = logging.getLogger(__name__)
def get_gpu_memory_map():
result = check_output(
["nvidia-smi", "--query-gpu=memory.used", "--format=csv,nounits,noheader"]
)
return... | true | true |
f72d79ada97cca1cd2f1a76f278ef92d3f365260 | 18,711 | py | Python | train.py | jtiscione/doodlecritic | 3af8245330523109b7452d3afc7d8d25d43d182c | [
"MIT"
] | 4 | 2019-07-22T09:56:31.000Z | 2019-09-20T16:12:19.000Z | train.py | jtiscione/doodlecritic | 3af8245330523109b7452d3afc7d8d25d43d182c | [
"MIT"
] | 1 | 2021-09-30T05:31:32.000Z | 2021-11-04T00:01:49.000Z | train.py | jtiscione/doodlecritic | 3af8245330523109b7452d3afc7d8d25d43d182c | [
"MIT"
] | null | null | null | import sys
import os
from os.path import expanduser
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
import torch.onnx
import re
import json
from PIL import Image, ImageDraw
import torch
import numpy as np
# Training script- trains a Pytorch model against the Google ... | 47.85422 | 149 | 0.644754 | import sys
import os
from os.path import expanduser
import pickle
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
import torch.onnx
import re
import json
from PIL import Image, ImageDraw
import torch
import numpy as np
#
# This way, if you need to edit a hyperparameter or go to ... | true | true |
f72d7b59f21fe73a417f27ac686824236356ac7e | 884 | py | Python | image_styles/urls.py | fotorius/django-image-styles | 29680851faf413c14b8b3e78c651725ce1e9c071 | [
"BSD-2-Clause"
] | null | null | null | image_styles/urls.py | fotorius/django-image-styles | 29680851faf413c14b8b3e78c651725ce1e9c071 | [
"BSD-2-Clause"
] | null | null | null | image_styles/urls.py | fotorius/django-image-styles | 29680851faf413c14b8b3e78c651725ce1e9c071 | [
"BSD-2-Clause"
] | null | null | null | from django.urls import include, re_path,path
from .views import EffectUpdateView,EffectCreateView,EffectCreateInitView
from .views import StyleView,RenderImageView
from .views import ManageImageStylesView
app_name = 'image_styles'
urlpatterns = [
path('',ManageImageStylesView.as_view(),name='manage_image_styles'... | 52 | 111 | 0.743213 | from django.urls import include, re_path,path
from .views import EffectUpdateView,EffectCreateView,EffectCreateInitView
from .views import StyleView,RenderImageView
from .views import ManageImageStylesView
app_name = 'image_styles'
urlpatterns = [
path('',ManageImageStylesView.as_view(),name='manage_image_styles'... | true | true |
f72d7cd9ced0441cf171005a09ff27dc4702f2d8 | 650 | py | Python | videos/migrations/0002_auto_20180112_0409.py | mleger45/turnex | 2b805c3681fe6ce3ddad403270c09ac9900fbe7d | [
"MIT"
] | null | null | null | videos/migrations/0002_auto_20180112_0409.py | mleger45/turnex | 2b805c3681fe6ce3ddad403270c09ac9900fbe7d | [
"MIT"
] | 1 | 2021-04-12T05:14:28.000Z | 2021-04-12T05:14:28.000Z | videos/migrations/0002_auto_20180112_0409.py | mleger45/turnex | 2b805c3681fe6ce3ddad403270c09ac9900fbe7d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-01-12 04:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('videos', '0001_initial'),
]
operations = [
migrations.AddField(
... | 24.074074 | 65 | 0.583077 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('videos', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='video',
name='title',
field=models.C... | true | true |
f72d7e72a009707d55813c1c29a5c3ce6628c6cf | 41 | py | Python | sciwing/engine/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 50 | 2019-09-13T10:32:29.000Z | 2022-02-14T16:52:53.000Z | sciwing/engine/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 31 | 2019-09-03T11:06:03.000Z | 2021-08-20T14:57:09.000Z | sciwing/engine/__init__.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 9 | 2019-09-16T03:25:15.000Z | 2021-05-11T10:28:25.000Z | from sciwing.engine.engine import Engine
| 20.5 | 40 | 0.853659 | from sciwing.engine.engine import Engine
| true | true |
f72d7e82dbcf325ad6a11fd6cfb982abaa5967b6 | 522 | py | Python | data_structures/array/array_file.py | Nobodylesszb/python_module | 37d2cdcf89a3ff02a9e560696a059cec9272bd1f | [
"MIT"
] | null | null | null | data_structures/array/array_file.py | Nobodylesszb/python_module | 37d2cdcf89a3ff02a9e560696a059cec9272bd1f | [
"MIT"
] | null | null | null | data_structures/array/array_file.py | Nobodylesszb/python_module | 37d2cdcf89a3ff02a9e560696a059cec9272bd1f | [
"MIT"
] | null | null | null | import array
import binascii
import tempfile
a = array.array('i', range(5))
print('A1:', a)
# Write the array of numbers to a temporary file
output = tempfile.NamedTemporaryFile()
a.tofile(output.file) # must pass an *actual* file
output.flush()
# Read the raw data
with open(output.name, 'rb') as input:
raw_dat... | 23.727273 | 54 | 0.676245 | import array
import binascii
import tempfile
a = array.array('i', range(5))
print('A1:', a)
output = tempfile.NamedTemporaryFile()
a.tofile(output.file) output.flush()
with open(output.name, 'rb') as input:
raw_data = input.read()
print('Raw Contents:', binascii.hexlify(raw_data))
input.seek(0)
... | true | true |
f72d80f16582b9bfbe602acdb4fb855e80acddf4 | 29,858 | py | Python | pylibs/schema.py | Leedehai/score | 1683368755cf7e1c11d1e924624a0d1f02c9cf52 | [
"MIT"
] | null | null | null | pylibs/schema.py | Leedehai/score | 1683368755cf7e1c11d1e924624a0d1f02c9cf52 | [
"MIT"
] | null | null | null | pylibs/schema.py | Leedehai/score | 1683368755cf7e1c11d1e924624a0d1f02c9cf52 | [
"MIT"
] | null | null | null | # https://github.com/keleshev/schema
# Copyright (c) 2012 Vladimir Keleshev, <vladimir@keleshev.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without l... | 38.132822 | 138 | 0.554357 |
import re
try:
from contextlib import ExitStack
except ImportError:
from contextlib2 import ExitStack
__version__ = "0.7.3"
__all__ = [
"Schema",
"And",
"Or",
"Regex",
"Optional",
"Use",
"Forbidden",
"Const",
"Literal",
"SchemaError",
"SchemaWrongKeyError",
"S... | true | true |
f72d80fec048e93c8380bd0fed8c96da03ae69b2 | 2,886 | py | Python | 2017/01.py | GillesArcas/Advent_of_Code | 1f57eb1686875df2684b0d56916b1d20724e9fb9 | [
"MIT"
] | null | null | null | 2017/01.py | GillesArcas/Advent_of_Code | 1f57eb1686875df2684b0d56916b1d20724e9fb9 | [
"MIT"
] | null | null | null | 2017/01.py | GillesArcas/Advent_of_Code | 1f57eb1686875df2684b0d56916b1d20724e9fb9 | [
"MIT"
] | null | null | null |
EXAMPLES1 = (
('1122', 3),
('1111', 4),
('1234', 0),
('91212129', 9)
)
EXAMPLES2 = (
('1212', 6),
('1221', 0),
('123425', 4),
('123123', 12),
('12131415', 4)
)
INPUT = '31813174349235972159811869755166343882958376474278437681632495222499211488649543755655138842553... | 78 | 2,162 | 0.878378 |
EXAMPLES1 = (
('1122', 3),
('1111', 4),
('1234', 0),
('91212129', 9)
)
EXAMPLES2 = (
('1212', 6),
('1221', 0),
('123425', 4),
('123123', 12),
('12131415', 4)
)
INPUT = '31813174349235972159811869755166343882958376474278437681632495222499211488649543755655138842553... | true | true |
f72d8160d3dc15e51fdf79766d92f5048e9ff644 | 4,718 | py | Python | src/ui/help.py | slinden2/uno-card-game | d648e2b305167678a1428694f64dd50cb83f657f | [
"MIT"
] | null | null | null | src/ui/help.py | slinden2/uno-card-game | d648e2b305167678a1428694f64dd50cb83f657f | [
"MIT"
] | null | null | null | src/ui/help.py | slinden2/uno-card-game | d648e2b305167678a1428694f64dd50cb83f657f | [
"MIT"
] | null | null | null | import tkinter as tk
import tkinter.font as tkFont
from tkinter import ttk
import webbrowser
from config import Config
import ui.main_menu
class HelpPage(tk.Frame):
def __init__(self, parent, controller):
"""Rules of the game
"""
super().__init__(parent)
self.controller = contr... | 34.437956 | 77 | 0.50106 | import tkinter as tk
import tkinter.font as tkFont
from tkinter import ttk
import webbrowser
from config import Config
import ui.main_menu
class HelpPage(tk.Frame):
def __init__(self, parent, controller):
super().__init__(parent)
self.controller = controller
for i in range(0, 12):
... | true | true |
f72d81a59c8b8dc7875de7cc95fb4147afde52f0 | 1,907 | py | Python | src/util/utils.py | rileymblaylock/bow_mnb | ecb693739ab23aafb4257f9448c06cc880bc52b2 | [
"MIT"
] | null | null | null | src/util/utils.py | rileymblaylock/bow_mnb | ecb693739ab23aafb4257f9448c06cc880bc52b2 | [
"MIT"
] | null | null | null | src/util/utils.py | rileymblaylock/bow_mnb | ecb693739ab23aafb4257f9448c06cc880bc52b2 | [
"MIT"
] | null | null | null | import math
def tfidf_calc(wordPerCat, numDocsWithTerm, totalDocs):
for i in wordPerCat:
for key, value in wordPerCat[i].items():
deted = int(numDocsWithTerm[key])
wordPerCat[i][key] = float(float(wordPerCat[i][key]) * (math.log(totalDocs/deted)))
return wordPerCat
def prior_pr... | 44.348837 | 156 | 0.671211 | import math
def tfidf_calc(wordPerCat, numDocsWithTerm, totalDocs):
for i in wordPerCat:
for key, value in wordPerCat[i].items():
deted = int(numDocsWithTerm[key])
wordPerCat[i][key] = float(float(wordPerCat[i][key]) * (math.log(totalDocs/deted)))
return wordPerCat
def prior_pr... | true | true |
f72d81d5f8e09b9387a63dd039e55e4dcd97c85d | 183 | py | Python | tests/kallisticore/test_urls.py | jpmorganchase/kallisti-core | d9dfcaa2ec3c9cd26dd37b5f2c39c3788a3d05aa | [
"Apache-2.0"
] | 1 | 2022-03-03T14:27:25.000Z | 2022-03-03T14:27:25.000Z | tests/kallisticore/test_urls.py | jpmorganchase/kallisti-core | d9dfcaa2ec3c9cd26dd37b5f2c39c3788a3d05aa | [
"Apache-2.0"
] | null | null | null | tests/kallisticore/test_urls.py | jpmorganchase/kallisti-core | d9dfcaa2ec3c9cd26dd37b5f2c39c3788a3d05aa | [
"Apache-2.0"
] | 1 | 2022-03-09T05:57:55.000Z | 2022-03-09T05:57:55.000Z | from django.test import TestCase
from django.urls import reverse
class TestUrls(TestCase):
def test_report(self):
self.assertEqual("/api/v1/report", reverse("report"))
| 20.333333 | 61 | 0.726776 | from django.test import TestCase
from django.urls import reverse
class TestUrls(TestCase):
def test_report(self):
self.assertEqual("/api/v1/report", reverse("report"))
| true | true |
f72d83a4c745ecf9567206de1d9571707318fded | 27,329 | py | Python | virtual/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 4 | 2022-02-06T00:54:58.000Z | 2022-02-25T12:44:43.000Z | virtual/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 1 | 2022-03-17T13:12:17.000Z | 2022-03-17T13:12:17.000Z | virtual/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 1 | 2022-02-08T13:43:20.000Z | 2022-02-08T13:43:20.000Z | # sql/visitors.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and expres... | 32.038687 | 79 | 0.663142 |
from collections import deque
import itertools
import operator
from .. import exc
from .. import util
from ..util import langhelpers
from ..util import symbol
__all__ = [
"iterate",
"traverse_using",
"traverse",
"cloned_traverse",
"replacement_traverse",
"Traversible",
"TraversibleType",... | true | true |
f72d842ae758c78892bcd330bd0ebd4e7323263e | 276 | py | Python | latex2minizinc/GenBelongsTo.py | rafaellc28/Latex2MiniZinc | 5c255a712156b915469329a07d13f1e984cbd247 | [
"MIT"
] | null | null | null | latex2minizinc/GenBelongsTo.py | rafaellc28/Latex2MiniZinc | 5c255a712156b915469329a07d13f1e984cbd247 | [
"MIT"
] | null | null | null | latex2minizinc/GenBelongsTo.py | rafaellc28/Latex2MiniZinc | 5c255a712156b915469329a07d13f1e984cbd247 | [
"MIT"
] | null | null | null | from GenObj import *
class GenBelongsTo(GenObj):
def __init__(self, name, stmtIndex):
super(GenBelongsTo, self).__init__(name)
self.stmtIndex = stmtIndex
def getStmtIndex(self):
return self.stmtIndex
def setStmtIndex(self, stmtIndex):
self.stmtIndex = stmtIndex
| 21.230769 | 42 | 0.76087 | from GenObj import *
class GenBelongsTo(GenObj):
def __init__(self, name, stmtIndex):
super(GenBelongsTo, self).__init__(name)
self.stmtIndex = stmtIndex
def getStmtIndex(self):
return self.stmtIndex
def setStmtIndex(self, stmtIndex):
self.stmtIndex = stmtIndex
| true | true |
f72d85337df8ef4d239e1842d4ab2254edd696b6 | 8,602 | py | Python | venv/lib/python3.10/site-packages/pandas/tests/series/methods/test_drop_duplicates.py | r-graves/demo_lab | 729cdf61774bf32d2c07ca68bf70e65470700cc2 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | venv/lib/python3.10/site-packages/pandas/tests/series/methods/test_drop_duplicates.py | r-graves/demo_lab | 729cdf61774bf32d2c07ca68bf70e65470700cc2 | [
"MIT"
] | 8 | 2021-09-22T12:47:32.000Z | 2022-01-14T21:30:38.000Z | venv/lib/python3.10/site-packages/pandas/tests/series/methods/test_drop_duplicates.py | r-graves/demo_lab | 729cdf61774bf32d2c07ca68bf70e65470700cc2 | [
"MIT"
] | 1 | 2021-11-18T10:45:16.000Z | 2021-11-18T10:45:16.000Z | import numpy as np
import pytest
from pandas import (
NA,
Categorical,
Series,
)
import pandas._testing as tm
@pytest.mark.parametrize(
"keep, expected",
[
("first", Series([False, False, False, False, True, True, False])),
("last", Series([False, True, True, False, False, False, ... | 33.866142 | 88 | 0.64578 | import numpy as np
import pytest
from pandas import (
NA,
Categorical,
Series,
)
import pandas._testing as tm
@pytest.mark.parametrize(
"keep, expected",
[
("first", Series([False, False, False, False, True, True, False])),
("last", Series([False, True, True, False, False, False, ... | true | true |
f72d861b9bac9b5ba86db78ac65832190f0c7ae3 | 3,736 | py | Python | src/ClusterBootstrap/scripts/move_keys_into_db.py | Anbang-Hu/DLWorkspace | 09d82aa5efd4dc9523fd956f913f73e53a85c3c2 | [
"MIT"
] | 38 | 2020-07-13T08:46:39.000Z | 2021-02-08T01:38:44.000Z | src/ClusterBootstrap/scripts/move_keys_into_db.py | Anbang-Hu/DLWorkspace | 09d82aa5efd4dc9523fd956f913f73e53a85c3c2 | [
"MIT"
] | null | null | null | src/ClusterBootstrap/scripts/move_keys_into_db.py | Anbang-Hu/DLWorkspace | 09d82aa5efd4dc9523fd956f913f73e53a85c3c2 | [
"MIT"
] | 20 | 2020-07-14T03:38:50.000Z | 2021-01-08T06:24:17.000Z | #!/usr/bin/env python3
import os
import sys
import yaml
import argparse
import logging
import mysql.connector
logger = logging.getLogger(__name__)
def build_mysql_connection(rest_config_path):
with open(rest_config_path) as f:
cluster_config = yaml.load(f)
host = cluster_config["mysql"]["hostname"... | 32.206897 | 90 | 0.591274 |
import os
import sys
import yaml
import argparse
import logging
import mysql.connector
logger = logging.getLogger(__name__)
def build_mysql_connection(rest_config_path):
with open(rest_config_path) as f:
cluster_config = yaml.load(f)
host = cluster_config["mysql"]["hostname"]
port = cluster_co... | true | true |
f72d8654bb38b434c13bdf313b5b3c9e76373332 | 3,325 | py | Python | include/dot_bdd.py | tyler-utah/PBDD | 3d53b09872efaf6825eb14de25b55584ed4f40bd | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2015-01-12T10:04:25.000Z | 2022-03-14T13:33:44.000Z | include/dot_bdd.py | tyler-utah/PBDD | 3d53b09872efaf6825eb14de25b55584ed4f40bd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | include/dot_bdd.py | tyler-utah/PBDD | 3d53b09872efaf6825eb14de25b55584ed4f40bd | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2015-10-09T05:41:38.000Z | 2019-01-26T23:34:17.000Z | #Tyler Sorensen
#University of Utah
#March 1, 2012
#dot_bdd.py
#This simply prints a .dot file for visualizing the bdd
#Only public function
def print_bdd(bdd, fileName):
"""
Generate a dot file with the bdd in it. Run the dot file through
dot and generate a ps file.
"""
#open the file
f1 = op... | 24.094203 | 86 | 0.520602 |
def print_bdd(bdd, fileName):
f1 = open(fileName, 'w')
_prDotHeader(f1)
_prNodes(f1, bdd)
_prRanks(f1, bdd)
_prEdges(f1, bdd, bdd["u"], [])
_prClosing(f1)
def _prClosing(f1):
f1.write("/* Unix command: dot -Tps bdd.dot > bdd.ps */\n")
f1.write(r"/* For fur... | true | true |
f72d8677c20fa3e3a54169d4eb48cb7ca7458055 | 11,575 | py | Python | OneSpanAnalysis_Mdl.py | Ivanfdezr/CentralSoftware | 8681fedd4814dc60deb527a370411350b40c994c | [
"MIT"
] | null | null | null | OneSpanAnalysis_Mdl.py | Ivanfdezr/CentralSoftware | 8681fedd4814dc60deb527a370411350b40c994c | [
"MIT"
] | 44 | 2021-02-10T23:58:28.000Z | 2021-12-14T02:38:21.000Z | OneSpanAnalysis_Mdl.py | Ivanfdezr/CentralSoftware | 8681fedd4814dc60deb527a370411350b40c994c | [
"MIT"
] | null | null | null | import numpy as np
import numpy.linalg as la
from MdlUtilities import Field, FieldList
import MdlUtilities as mdl
def get_osaCasing_fields():
OD = Field(2030)
ID = Field(2031)
Weight = Field(2032)
Density = Field(2039)
E = Field(2040)
osaCasing_fields = FieldList()
osaCasing_... | 35.506135 | 149 | 0.723629 | import numpy as np
import numpy.linalg as la
from MdlUtilities import Field, FieldList
import MdlUtilities as mdl
def get_osaCasing_fields():
OD = Field(2030)
ID = Field(2031)
Weight = Field(2032)
Density = Field(2039)
E = Field(2040)
osaCasing_fields = FieldList()
osaCasing_... | true | true |
f72d8828ff9e26570c02649cb01fa01ec0782c9c | 842 | py | Python | decoradores.py | daniela2001-png/PYTHON-REVIEW-TOPICS | 203c88492267c9a6a6c05cb75bcbb5e4d78cb295 | [
"MIT"
] | null | null | null | decoradores.py | daniela2001-png/PYTHON-REVIEW-TOPICS | 203c88492267c9a6a6c05cb75bcbb5e4d78cb295 | [
"MIT"
] | null | null | null | decoradores.py | daniela2001-png/PYTHON-REVIEW-TOPICS | 203c88492267c9a6a6c05cb75bcbb5e4d78cb295 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Creando mi propio decorador
y entendiendolos
¿ Qué es un decorador ?
- Un decorador básicamente toma una función,
le añade alguna funcionalidad y la retorna.
"""
# Ejemplo:
def funcion_decorador(funcion):
def wrapper():
print("llamando a mi funcion")
funcion()
... | 19.581395 | 90 | 0.706651 |
def funcion_decorador(funcion):
def wrapper():
print("llamando a mi funcion")
funcion()
print("finalizo llamado")
return wrapper
@funcion_decorador
def ejemplo():
print("soy una funcion ejemplo que tendra una nueva funcionalidad cuando sea llmada!")
print(ejemplo())
| true | true |
f72d8837ef94b47804da55b302a6ffd384200c01 | 6,156 | py | Python | loss.py | HitkoDev/triplet-reid | d80edf7bdcee2ebcab160f1a06224837ac624329 | [
"MIT"
] | null | null | null | loss.py | HitkoDev/triplet-reid | d80edf7bdcee2ebcab160f1a06224837ac624329 | [
"MIT"
] | null | null | null | loss.py | HitkoDev/triplet-reid | d80edf7bdcee2ebcab160f1a06224837ac624329 | [
"MIT"
] | null | null | null | import numbers
import tensorflow as tf
def all_diffs(a, b):
""" Returns a tensor of all combinations of a - b.
Args:
a (2D tensor): A batch of vectors shaped (B1, F).
b (2D tensor): A batch of vectors shaped (B2, F).
Returns:
The matrix of all pairwise differences between all vec... | 40.768212 | 115 | 0.635802 | import numbers
import tensorflow as tf
def all_diffs(a, b):
return tf.expand_dims(a, axis=1) - tf.expand_dims(b, axis=0)
def cdist(a, b, metric='euclidean'):
with tf.compat.v1.name_scope("cdist"):
diffs = all_diffs(a, b)
if metric == 'sqeuclidean':
return tf.reduce_sum(input_tens... | true | true |
f72d885c2821d0dd8389f957464f9c9db74649a9 | 2,395 | py | Python | rcsb/utils/tests-targets/testCARDTargetFeatureProvider.py | rcsb/py-rcsb_utils_targets | 1796ae15186df22a4167c4554aec1dca4b16539b | [
"Apache-2.0"
] | null | null | null | rcsb/utils/tests-targets/testCARDTargetFeatureProvider.py | rcsb/py-rcsb_utils_targets | 1796ae15186df22a4167c4554aec1dca4b16539b | [
"Apache-2.0"
] | null | null | null | rcsb/utils/tests-targets/testCARDTargetFeatureProvider.py | rcsb/py-rcsb_utils_targets | 1796ae15186df22a4167c4554aec1dca4b16539b | [
"Apache-2.0"
] | null | null | null | ##
# File: CARDTargetFeatureProviderTests.py
# Author: J. Westbrook
# Date: 11-Jun-2021
# Version: 0.001
#
# Update:
#
#
##
"""
Tests for utilities managing CARD target data.
"""
__docformat__ = "google en"
__author__ = "John Westbrook"
__email__ = "jwest@rcsb.rutgers.edu"
__license__ = "Apache 2.0"
import log... | 31.933333 | 149 | 0.694363 |
__docformat__ = "google en"
__author__ = "John Westbrook"
__email__ = "jwest@rcsb.rutgers.edu"
__license__ = "Apache 2.0"
import logging
import os
import platform
import resource
import time
import unittest
from rcsb.utils.targets.CARDTargetFeatureProvider import CARDTargetFeatureProvider
HERE = os.path.abspath(os.... | true | true |
f72d886ac003b22033ad97f0998cbc701ccac80c | 2,411 | py | Python | kaggle/mnist/bayes/naivebayes.py | fg6/MachineLearning | 7c3f6e8f2f90b729dbcc345c5a8a5da712cfbb27 | [
"MIT"
] | null | null | null | kaggle/mnist/bayes/naivebayes.py | fg6/MachineLearning | 7c3f6e8f2f90b729dbcc345c5a8a5da712cfbb27 | [
"MIT"
] | null | null | null | kaggle/mnist/bayes/naivebayes.py | fg6/MachineLearning | 7c3f6e8f2f90b729dbcc345c5a8a5da712cfbb27 | [
"MIT"
] | 1 | 2019-05-15T02:17:22.000Z | 2019-05-15T02:17:22.000Z |
import numpy as np
from sortedcontainers import SortedList
from scipy.stats import multivariate_normal
class NaiveBayes:
#def __init__(self):
# pass
def fit(self, X, Y):
self.X = X
self.Y = set(Y)
self.Classes = set(Y)
self.Prior = {}
self.G = {}
# smo... | 25.924731 | 109 | 0.498548 |
import numpy as np
from sortedcontainers import SortedList
from scipy.stats import multivariate_normal
class NaiveBayes:
def fit(self, X, Y):
self.X = X
self.Y = set(Y)
self.Classes = set(Y)
self.Prior = {}
self.G = {}
epsilon=0.001*np.identity(28... | true | true |
f72d88fab45b476987edef7d50bb524e562ad941 | 89 | py | Python | src/eversource_scraper/__init__.py | Haeilifax/eversource_scraper | 4652ff82a57124e0b83644c8776d6e54a39103be | [
"MIT"
] | null | null | null | src/eversource_scraper/__init__.py | Haeilifax/eversource_scraper | 4652ff82a57124e0b83644c8776d6e54a39103be | [
"MIT"
] | null | null | null | src/eversource_scraper/__init__.py | Haeilifax/eversource_scraper | 4652ff82a57124e0b83644c8776d6e54a39103be | [
"MIT"
] | null | null | null | from eversource_scraper import (selenium_scraper, mysql_inserter)
__version__ = "0.1.0"
| 22.25 | 65 | 0.808989 | from eversource_scraper import (selenium_scraper, mysql_inserter)
__version__ = "0.1.0"
| true | true |
f72d894c5dd643cc66f3cf18f2330569c6a1b5c9 | 6,672 | py | Python | bindings/python/ensmallen_graph/datasets/string/pantoearwandensis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/pantoearwandensis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/pantoearwandensis.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Pantoea rwandensis.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02-... | 34.931937 | 223 | 0.702938 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def PantoeaRwandensis(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
retur... | true | true |
f72d896778f8cdb96ceeedf64eb8c606fcdc07b1 | 24 | py | Python | example_snippets/multimenus_snippets/NewSnippets/SymPy/Manipulating expressions/Exponentials and Logarithms/Combine exponentials.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/NewSnippets/SymPy/Manipulating expressions/Exponentials and Logarithms/Combine exponentials.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/NewSnippets/SymPy/Manipulating expressions/Exponentials and Logarithms/Combine exponentials.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | powsimp(exp(y) * exp(z)) | 24 | 24 | 0.625 | powsimp(exp(y) * exp(z)) | true | true |
f72d89796eb4cedeea9887765fdd33a3f277fd71 | 178,860 | py | Python | src/azure-cli/azure/cli/command_modules/vm/custom.py | nexxai/azure-cli | 3f24ada49f3323d9310d46ccc1025dc99fc4cf8e | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/vm/custom.py | nexxai/azure-cli | 3f24ada49f3323d9310d46ccc1025dc99fc4cf8e | [
"MIT"
] | 1 | 2021-02-24T09:10:12.000Z | 2021-02-24T09:10:12.000Z | src/azure-cli/azure/cli/command_modules/vm/custom.py | nexxai/azure-cli | 3f24ada49f3323d9310d46ccc1025dc99fc4cf8e | [
"MIT"
] | 1 | 2020-09-07T18:44:14.000Z | 2020-09-07T18:44:14.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 51.381787 | 163 | 0.695868 |
from __future__ import print_function
import json
import os
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from six.moves.urllib.request import urlopen
from knack.log import get_logger
from knack.util import CLIError
from azure.cli.command_modules.vm._validators ... | true | true |
f72d89f927ae8b3502ffbda7f60181ea25a41dcd | 9,240 | py | Python | run_align.py | gitlost-murali/awesome-align | 39fb45ca85a98e005447bddb52c48e65ce7d399b | [
"BSD-3-Clause"
] | null | null | null | run_align.py | gitlost-murali/awesome-align | 39fb45ca85a98e005447bddb52c48e65ce7d399b | [
"BSD-3-Clause"
] | null | null | null | run_align.py | gitlost-murali/awesome-align | 39fb45ca85a98e005447bddb52c48e65ce7d399b | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Modifications copyright (C) 2020 Zi-Yi Dou
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 42.580645 | 285 | 0.660281 |
import argparse
import random
import itertools
import os
import numpy as np
import torch
from tqdm import trange
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import DataLoader, Dataset, SequentialSampler
import modeling
from configuration_bert import BertConfig
from modeling import BertForMaske... | true | true |
f72d8a16b6feb1fb6bd072d2c7ac219ebc166969 | 1,867 | py | Python | JianShuSpider/spiders/search_spider.py | xiaoshicae/Others | a5df75f1da527f94c1c79870a8f5ac7c9a7353c2 | [
"Apache-1.1"
] | null | null | null | JianShuSpider/spiders/search_spider.py | xiaoshicae/Others | a5df75f1da527f94c1c79870a8f5ac7c9a7353c2 | [
"Apache-1.1"
] | null | null | null | JianShuSpider/spiders/search_spider.py | xiaoshicae/Others | a5df75f1da527f94c1c79870a8f5ac7c9a7353c2 | [
"Apache-1.1"
] | null | null | null | # --*-- coding: utf-8 --*--
# --------------------------------------------------------------------------------
# Description:
# search_spider负责将搜索结果扔进redis队列,提供给page_spider消费
# 两步爬虫分离,实现分布式,弹性扩展
# DATE:
# 2018/02/01
# BY:
# xiaoshicae
# --------------------------------------------------------... | 33.945455 | 112 | 0.587574 | import re
import json
from scrapy.http import Request
from jianshu.scrapy_redis.spiders import RedisSpider
from jianshu.items import PageItem
class SearchSpider(RedisSpider):
name = "SearchSpider"
redis_key = "%s:start_urls" % name
def make_requests_from_url(self, url):
retu... | true | true |
f72d8a69e94886b1bc1362136e57364ff82afbb0 | 2,924 | gyp | Python | build/re2.gyp | nodenative/nodenative | cf988c9399e0793b1b8c29a8ffd09e910d1a0cb3 | [
"MIT"
] | 16 | 2016-03-16T22:16:18.000Z | 2021-04-05T04:46:38.000Z | build/re2.gyp | nodenative/nodenative | cf988c9399e0793b1b8c29a8ffd09e910d1a0cb3 | [
"MIT"
] | 11 | 2016-03-16T22:02:26.000Z | 2021-04-04T02:20:51.000Z | build/re2.gyp | nodenative/nodenative | cf988c9399e0793b1b8c29a8ffd09e910d1a0cb3 | [
"MIT"
] | 5 | 2016-03-22T14:03:34.000Z | 2021-01-06T18:08:46.000Z | {
'targets': [
{
'target_name': 're2',
'type': 'static_library',
'include_dirs': [
'../deps/re2',
],
'direct_dependent_settings': {
'include_dirs': [
'../deps/re2',
],
},
'sources': [
'../deps/re2/re2/bitmap256.h',
'../dep... | 30.458333 | 79 | 0.461354 | {
'targets': [
{
'target_name': 're2',
'type': 'static_library',
'include_dirs': [
'../deps/re2',
],
'direct_dependent_settings': {
'include_dirs': [
'../deps/re2',
],
},
'sources': [
'../deps/re2/re2/bitmap256.h',
'../dep... | true | true |
f72d8aaa5262c683925ab0a07528a4305056d570 | 15,149 | py | Python | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/core/application.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 26 | 2018-02-14T23:52:58.000Z | 2021-08-16T13:50:03.000Z | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/core/application.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/ipython-1.2.1-py27_0/lib/python2.7/site-packages/IPython/core/application.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 10 | 2018-08-13T19:38:39.000Z | 2020-04-19T03:02:00.000Z | # encoding: utf-8
"""
An application for IPython.
All top-level applications should use the classes in this module for
handling configuration and creating componenets.
The job of an :class:`Application` is to create the master configuration
object and then create the configurable objects, passing the config to them.
... | 39.348052 | 110 | 0.582481 |
import atexit
import glob
import logging
import os
import shutil
import sys
from IPython.config.application import Application, catch_config_error
from IPython.config.loader import ConfigFileNotFound
from IPython.core import release, crashhandler
from IPython.core.profiledir import ProfileDir, ProfileDirError
from ... | true | true |
f72d8c40013d261c62b6339a86bfa224ef3dfb81 | 141,438 | py | Python | conans/client/migrations_settings.py | VitaliiOsykovSC/conan | cc7d529e2c91b78490619482e867301e5fd78daa | [
"MIT"
] | null | null | null | conans/client/migrations_settings.py | VitaliiOsykovSC/conan | cc7d529e2c91b78490619482e867301e5fd78daa | [
"MIT"
] | null | null | null | conans/client/migrations_settings.py | VitaliiOsykovSC/conan | cc7d529e2c91b78490619482e867301e5fd78daa | [
"MIT"
] | null | null | null | settings_1_9_0 = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc64le, ppc64, armv6, armv7, armv7hf, armv8, sparc, sparcv9, mips, mips64, avr, armv7s, armv7k]
# Only for building cross compil... | 47.718623 | 290 | 0.527977 | settings_1_9_0 = """
# Only for cross building, 'os_build/arch_build' is the system that runs Conan
os_build: [Windows, WindowsStore, Linux, Macos, FreeBSD, SunOS]
arch_build: [x86, x86_64, ppc64le, ppc64, armv6, armv7, armv7hf, armv8, sparc, sparcv9, mips, mips64, avr, armv7s, armv7k]
# Only for building cross compil... | true | true |
f72d8ce087b0b710f68d7f8b8da4bd9a2dd64c10 | 13,199 | py | Python | python/qpid_dispatch_internal/policy/policy_util.py | bartoval/skupper-router | b62f8376f2e2d4fb78a92bd8916b43b857ab48cc | [
"Apache-2.0"
] | null | null | null | python/qpid_dispatch_internal/policy/policy_util.py | bartoval/skupper-router | b62f8376f2e2d4fb78a92bd8916b43b857ab48cc | [
"Apache-2.0"
] | null | null | null | python/qpid_dispatch_internal/policy/policy_util.py | bartoval/skupper-router | b62f8376f2e2d4fb78a92bd8916b43b857ab48cc | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 36.971989 | 109 | 0.598303 |
import socket
import binascii
class PolicyError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return str(self.value)
def is_ipv6_enabled():
ipv6_enabled = True
try:
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock.bind((... | true | true |
f72d8cf23cc5609bf9167436c3ec295515e7bddb | 4,477 | py | Python | src/lightextclassification/imdb.py | duoan/light-text-classification | 6c96c9fb6b52abd42e4b4358cb85c44473731668 | [
"MIT"
] | 1 | 2021-03-20T20:59:57.000Z | 2021-03-20T20:59:57.000Z | src/lightextclassification/imdb.py | classtag/light-text-classification | 6c96c9fb6b52abd42e4b4358cb85c44473731668 | [
"MIT"
] | 244 | 2018-11-22T13:37:48.000Z | 2021-07-14T18:40:29.000Z | src/lightextclassification/imdb.py | duoan/light-text-classification | 6c96c9fb6b52abd42e4b4358cb85c44473731668 | [
"MIT"
] | 1 | 2018-11-22T12:03:13.000Z | 2018-11-22T12:03:13.000Z | # _*_ coding: utf-8 _*_
from argparse import ArgumentParser
import torch
from torchtext import data, datasets
from vocab import LocalVectors
from models import *
from torch.optim import SGD
from torch.utils.data import DataLoader
from ignite.engine import Events, create_supervised_trainer, create_supervised_evaluat... | 30.875862 | 122 | 0.688184 | from argparse import ArgumentParser
import torch
from torchtext import data, datasets
from vocab import LocalVectors
from models import *
from torch.optim import SGD
from torch.utils.data import DataLoader
from ignite.engine import Events, create_supervised_trainer, create_supervised_evaluator
from ignite.metrics i... | true | true |
f72d8d7b7cf9155185aabc026bb4c4602f0f19fc | 66,826 | py | Python | sympy/core/basic.py | MartinThoma/sympy | 009d0031bec7222ffa472e52148a2b4e441cd3a5 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/basic.py | MartinThoma/sympy | 009d0031bec7222ffa472e52148a2b4e441cd3a5 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/basic.py | MartinThoma/sympy | 009d0031bec7222ffa472e52148a2b4e441cd3a5 | [
"BSD-3-Clause"
] | null | null | null | """Base class for all the objects in SymPy"""
from collections import defaultdict
from itertools import chain, zip_longest
from .assumptions import BasicMeta, ManagedProperties
from .cache import cacheit
from .sympify import _sympify, sympify, SympifyError
from .compatibility import iterable, ordered, Mapping
from .si... | 32.550414 | 103 | 0.541645 | from collections import defaultdict
from itertools import chain, zip_longest
from .assumptions import BasicMeta, ManagedProperties
from .cache import cacheit
from .sympify import _sympify, sympify, SympifyError
from .compatibility import iterable, ordered, Mapping
from .singleton import S
from inspect import getmro
... | true | true |
f72d8d821c1671e10a95f3d6047d6a3edb552952 | 1,999 | py | Python | modules/dbnd/test_dbnd/run/test_log_metrics_commands.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | modules/dbnd/test_dbnd/run/test_log_metrics_commands.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | modules/dbnd/test_dbnd/run/test_log_metrics_commands.py | turbaszek/dbnd | 6efbf3e7ecd175645e8e58d0d015d32fe9e95ea0 | [
"Apache-2.0"
] | null | null | null | import os
from typing import Dict
from dbnd import as_task, band, task
from dbnd._core.commands import log_artifact, log_metric
from dbnd._core.current import get_databand_run
from dbnd._core.tracking.tracking_store_file import read_task_metrics
from dbnd.testing.helpers_pytest import assert_run_task
from test_dbnd.t... | 30.287879 | 117 | 0.634817 | import os
from typing import Dict
from dbnd import as_task, band, task
from dbnd._core.commands import log_artifact, log_metric
from dbnd._core.current import get_databand_run
from dbnd._core.tracking.tracking_store_file import read_task_metrics
from dbnd.testing.helpers_pytest import assert_run_task
from test_dbnd.t... | true | true |
f72d8ea026a247a21f48ec3e729b5a1627b6ab98 | 2,746 | py | Python | ios/web_view/PRESUBMIT_test.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 | ios/web_view/PRESUBMIT_test.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 | ios/web_view/PRESUBMIT_test.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 | # Copyright 2020 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
import PRESUBMIT
# append the path of src/ to sys.path to import PRESUBMIT_test_mocks
SRC_IOS_WEB_VIEW_PATH = os.path... | 36.613333 | 80 | 0.637291 |
import os
import sys
import unittest
import PRESUBMIT
SRC_IOS_WEB_VIEW_PATH = os.path.dirname(os.path.abspath(__file__))
SRC_PATH = os.path.dirname(os.path.dirname(SRC_IOS_WEB_VIEW_PATH))
sys.path.append(SRC_PATH)
import PRESUBMIT_test_mocks
class InclusionPathCheckerTest(unittest.TestCase):
def testInclusionP... | true | true |
f72d8f50dd5091fb3db1affbd4c3e936c1aff93a | 2,332 | py | Python | sqlalchemy_geonames/files.py | dionysio/sqlalchemy-geonames | 0d2542cf53512b14415319f23ad53dc4994691a8 | [
"BSD-2-Clause-FreeBSD"
] | 17 | 2015-02-24T20:20:49.000Z | 2021-07-21T02:32:15.000Z | sqlalchemy_geonames/files.py | dionysio/sqlalchemy-geonames | 0d2542cf53512b14415319f23ad53dc4994691a8 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2016-11-13T17:00:26.000Z | 2020-05-28T13:12:07.000Z | sqlalchemy_geonames/files.py | dionysio/sqlalchemy-geonames | 0d2542cf53512b14415319f23ad53dc4994691a8 | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2015-03-28T12:23:50.000Z | 2020-05-28T08:41:50.000Z | BASE_DOWNLOAD_URL = 'http://download.geonames.org/export/dump/'
def full_url(filename):
return BASE_DOWNLOAD_URL + filename
filename_config = {
'admin1CodesASCII.txt': {
'url': full_url('admin1CodesASCII.txt'),
},
'admin2Codes.txt': {
'url': full_url('admin2Codes.txt'),
},
'a... | 25.626374 | 63 | 0.551458 | BASE_DOWNLOAD_URL = 'http://download.geonames.org/export/dump/'
def full_url(filename):
return BASE_DOWNLOAD_URL + filename
filename_config = {
'admin1CodesASCII.txt': {
'url': full_url('admin1CodesASCII.txt'),
},
'admin2Codes.txt': {
'url': full_url('admin2Codes.txt'),
},
'a... | true | true |
f72d911064ee83731fb01489837fcc983c05458c | 2,670 | py | Python | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/ModifyReplicaModeRequest.py | DataDog/aliyun-openapi-python-sdk | 5cbee29bce6416dd62f61f0c3786b1af6ea0d84f | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/ModifyReplicaModeRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/ModifyReplicaModeRequest.py | liusc27/aliyun-openapi-python-sdk | 5e3db3535dd21de987dc5981e71151327d5a884f | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.230769 | 76 | 0.774532 |
from aliyunsdkcore.request import RpcRequest
class ModifyReplicaModeRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Rds', '2014-08-15', 'ModifyReplicaMode','rds')
def get_DomainMode(self):
return self.get_query_params().get('DomainMode')
def set_DomainMode(self,DomainMode):
self.a... | true | true |
f72d9189a05cf033d697164df047e31ba089901c | 560 | py | Python | test/services_tests/test_game_service.py | rhsu/slackjack | c6ba6ec97fcf669c8f4dddc83a3b03cd829ec792 | [
"MIT"
] | null | null | null | test/services_tests/test_game_service.py | rhsu/slackjack | c6ba6ec97fcf669c8f4dddc83a3b03cd829ec792 | [
"MIT"
] | 8 | 2019-03-25T23:11:54.000Z | 2019-04-09T23:38:23.000Z | test/services_tests/test_game_service.py | rhsu/slackjack | c6ba6ec97fcf669c8f4dddc83a3b03cd829ec792 | [
"MIT"
] | 1 | 2019-04-04T00:12:35.000Z | 2019-04-04T00:12:35.000Z | from services.game_service import GameService
from test.mocks.mock_objects import MockEndgameService
def test_play_works_with_no_hand(default_user_data):
service = GameService(default_user_data, MockEndgameService())
response = service.play()
assert response is not None
assert len(service.hand()) == 2... | 32.941176 | 66 | 0.782143 | from services.game_service import GameService
from test.mocks.mock_objects import MockEndgameService
def test_play_works_with_no_hand(default_user_data):
service = GameService(default_user_data, MockEndgameService())
response = service.play()
assert response is not None
assert len(service.hand()) == 2... | true | true |
f72d91d7965629ca9512adf5a81d10f7c72e8a9b | 21,546 | py | Python | sdk/python/pulumi_aws/lakeformation/outputs.py | aamir-locus/pulumi-aws | 3e234b050129bde35d8e072a88bd608562f02142 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lakeformation/outputs.py | aamir-locus/pulumi-aws | 3e234b050129bde35d8e072a88bd608562f02142 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/lakeformation/outputs.py | aamir-locus/pulumi-aws | 3e234b050129bde35d8e072a88bd608562f02142 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 37.471304 | 337 | 0.633482 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'DataLakeSettingsCreateDatabaseDefaultPermission',
'DataLakeSettingsCreateTableDefaultPermission',
'PermissionsDataLocation',
'PermissionsDatab... | true | true |
f72d9252e9bb0a32ba37dc42ebe896887438d7a8 | 2,930 | py | Python | plugins/dbnd-docker/src/dbnd_docker/container_engine_config.py | busunkim96/dbnd | 0191fdcd4c4fbd35006f1026d1a55b2abab9097b | [
"Apache-2.0"
] | 224 | 2020-01-02T10:46:37.000Z | 2022-03-02T13:54:08.000Z | plugins/dbnd-docker/src/dbnd_docker/container_engine_config.py | busunkim96/dbnd | 0191fdcd4c4fbd35006f1026d1a55b2abab9097b | [
"Apache-2.0"
] | 16 | 2020-03-11T09:37:58.000Z | 2022-01-26T10:22:08.000Z | plugins/dbnd-docker/src/dbnd_docker/container_engine_config.py | busunkim96/dbnd | 0191fdcd4c4fbd35006f1026d1a55b2abab9097b | [
"Apache-2.0"
] | 24 | 2020-03-24T13:53:50.000Z | 2022-03-22T11:55:18.000Z | import subprocess
from dbnd import parameter
from dbnd._core.parameter.validators import NonEmptyString
from dbnd._core.run.databand_run import DatabandRun
from dbnd._core.settings import EngineConfig
from targets.values.version_value import VersionStr
class ContainerEngineConfig(EngineConfig):
require_submit = ... | 37.564103 | 111 | 0.696928 | import subprocess
from dbnd import parameter
from dbnd._core.parameter.validators import NonEmptyString
from dbnd._core.run.databand_run import DatabandRun
from dbnd._core.settings import EngineConfig
from targets.values.version_value import VersionStr
class ContainerEngineConfig(EngineConfig):
require_submit = ... | true | true |
f72d929e9c08be5c45b8e9ee81bea161824633b0 | 661 | py | Python | Sorting/Selection Sort/selection_sort.py | Lashuk1729/PyAlgo-Tree | c8546ba45161a8c9ac87dc2710b5fb944568f5b1 | [
"MIT"
] | 24 | 2021-07-06T10:08:46.000Z | 2021-10-17T20:18:41.000Z | Sorting/Selection Sort/selection_sort.py | Lashuk1729/PyAlgo-Tree | c8546ba45161a8c9ac87dc2710b5fb944568f5b1 | [
"MIT"
] | 159 | 2021-06-06T12:44:09.000Z | 2021-10-31T14:25:28.000Z | Sorting/Selection Sort/selection_sort.py | Lashuk1729/PyAlgo-Tree | c8546ba45161a8c9ac87dc2710b5fb944568f5b1 | [
"MIT"
] | 47 | 2021-07-05T16:32:14.000Z | 2021-11-01T13:59:16.000Z | def selectionSort(array, n):
for i in range(n):
minimum = i
for j in range(i + 1, n):
# to sort in descending order, change > to < in this line
# select the minimum element in each loop
if array[j] < array[minimum]:
minimum = j
... | 26.44 | 69 | 0.562784 | def selectionSort(array, n):
for i in range(n):
minimum = i
for j in range(i + 1, n):
if array[j] < array[minimum]:
minimum = j
(array[i], array[minimum]) = (array[minimum], array[i])
data = [ ]
size = int... | true | true |
f72d9323fed3cb0d5783a901014f576253fb4d86 | 1,028 | py | Python | django/solution/untitled/ksiazkaadresowa/management/commands/clean.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | 1 | 2019-01-02T15:04:08.000Z | 2019-01-02T15:04:08.000Z | django/solution/untitled/ksiazkaadresowa/management/commands/clean.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | null | null | null | django/solution/untitled/ksiazkaadresowa/management/commands/clean.py | giserh/book-python | ebd4e70cea1dd56986aa8efbae3629ba3f1ba087 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from ksiazkaadresowa.models import Person
class Command(BaseCommand):
help = 'Moj tekst pomocy'
def add_arguments(self, parser):
parser.add_argument(
'--file',
dest='file',
nargs='?',
help='Log File',
... | 23.906977 | 51 | 0.51751 | from django.core.management.base import BaseCommand
from ksiazkaadresowa.models import Person
class Command(BaseCommand):
help = 'Moj tekst pomocy'
def add_arguments(self, parser):
parser.add_argument(
'--file',
dest='file',
nargs='?',
help='Log File',
... | true | true |
f72d9348637b3cd7722c51c6e5c4d93b8b735f0c | 5,928 | py | Python | baselines/cher/experiment/config.py | krishpop/CHER | 0633a45151b13f23acf20faabc65028c599a3551 | [
"MIT"
] | 38 | 2019-10-21T14:04:33.000Z | 2022-01-18T05:31:26.000Z | baselines/cher/experiment/config.py | krishpop/CHER | 0633a45151b13f23acf20faabc65028c599a3551 | [
"MIT"
] | 3 | 2019-12-12T01:36:12.000Z | 2021-04-21T19:53:55.000Z | baselines/cher/experiment/config.py | krishpop/CHER | 0633a45151b13f23acf20faabc65028c599a3551 | [
"MIT"
] | 12 | 2019-12-06T03:46:02.000Z | 2021-12-01T11:17:07.000Z | from copy import deepcopy
import numpy as np
import json
import os
import gym
from baselines import logger
from baselines.her.ddpg import DDPG
from baselines.cher.her import make_sample_her_transitions
DEFAULT_ENV_PARAMS = {
'FetchReach-v0': {
'n_cycles': 10,
},
}
DEFAULT_PARAMS = {
# env
... | 34.465116 | 110 | 0.63529 | from copy import deepcopy
import numpy as np
import json
import os
import gym
from baselines import logger
from baselines.her.ddpg import DDPG
from baselines.cher.her import make_sample_her_transitions
DEFAULT_ENV_PARAMS = {
'FetchReach-v0': {
'n_cycles': 10,
},
}
DEFAULT_PARAMS = {
'max_u... | true | true |
f72d93705daed63829c2d128d4788b910c9a36be | 2,748 | py | Python | var/spack/repos/builtin/packages/w3m/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/w3m/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/w3m/package.py | Kerilk/spack | e027942b55407a4a5fe323b93d8e57200c873a43 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-04-06T09:04:11.000Z | 2020-01-24T12:52:12.000Z | # 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 W3m(AutotoolsPackage):
"""
w3m is a text-based web browser as well as a pager like `mo... | 35.688312 | 95 | 0.652838 |
from spack import *
class W3m(AutotoolsPackage):
homepage = "http://w3m.sourceforge.net/index.en.html"
url = "https://downloads.sourceforge.net/project/w3m/w3m/w3m-0.5.3/w3m-0.5.3.tar.gz"
maintainers = ['ronin_gw']
version('0.5.3', sha256='e994d263f2fd2c22febfbe45103526e00145a7674a0fda79c822b... | true | true |
f72d93713d6d8410399ade77878b0f44c3d290fb | 2,666 | py | Python | netanalysis/dns/data/model.py | Jigsaw-Code/net-analysis | 2b36fe89c3305f4d1c93406725a7f46a74f246f9 | [
"Apache-2.0"
] | 88 | 2018-03-06T16:21:25.000Z | 2022-03-30T20:59:20.000Z | netanalysis/dns/data/model.py | Jigsaw-Code/net-analysis | 2b36fe89c3305f4d1c93406725a7f46a74f246f9 | [
"Apache-2.0"
] | 6 | 2020-03-02T18:06:06.000Z | 2022-03-16T10:35:57.000Z | netanalysis/dns/data/model.py | Jigsaw-Code/net-analysis | 2b36fe89c3305f4d1c93406725a7f46a74f246f9 | [
"Apache-2.0"
] | 23 | 2018-03-21T12:56:53.000Z | 2022-03-25T19:48:30.000Z | # Copyright 2018 Jigsaw Operations LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.364706 | 98 | 0.643286 |
import datetime
from ipaddress import ip_address, IPv4Address, IPv6Address
from typing import List, Union
class RecordData:
def __repr__(self):
return "%s(%s)" % (self.__class__, str(self.__dict__))
class IpAddressData(RecordData):
def __init__(self, ip_str: str) -> None:
self._ip = ip_ad... | true | true |
f72d946353539b8f82bb86b10544528e8e6c6521 | 3,783 | py | Python | Note7_Learn Python_Dictionaries.py | stanreport/Python-Tutorials | 7aff8ff7c21d4face1afb218ab9679f3d1160e27 | [
"Apache-2.0"
] | null | null | null | Note7_Learn Python_Dictionaries.py | stanreport/Python-Tutorials | 7aff8ff7c21d4face1afb218ab9679f3d1160e27 | [
"Apache-2.0"
] | 1 | 2018-04-14T19:35:14.000Z | 2018-04-14T19:35:14.000Z | Note7_Learn Python_Dictionaries.py | stanreport/Python-Tutorials | 7aff8ff7c21d4face1afb218ab9679f3d1160e27 | [
"Apache-2.0"
] | null | null | null | # ---------- LEARN TO PROGRAM 7 ----------
# ---------- DICTIONARIES ----------
# While lists organize data based on sequential indexes
# Dictionaries instead use key / value pairs.
# A key / value pair could be
# fName : "Derek" where fName is the key and "Derek" is
# the value
# Create a Dictionary about me
derek... | 23.067073 | 74 | 0.626751 |
derekDict = {"fName": "Derek", "lName": "Banas", "address": "123 Main St"}
print("May name :", derekDict["fName"])
derekDict["address"] = "215 North St"
print(derekDict)
derekDict['city'] = 'Pittsburgh'
print("Is there a city :", "city" in derekDict)
print(derekDict.values())
print(derekDict.keys())
for k, ... | true | true |
f72d949d658d47131c4a502292aadd093d90b245 | 212 | py | Python | test-examples/million_points.py | tlambert03/image-demos | a2974bcc7f040fd4d14e659c4cbfeabcf726c707 | [
"BSD-3-Clause"
] | null | null | null | test-examples/million_points.py | tlambert03/image-demos | a2974bcc7f040fd4d14e659c4cbfeabcf726c707 | [
"BSD-3-Clause"
] | null | null | null | test-examples/million_points.py | tlambert03/image-demos | a2974bcc7f040fd4d14e659c4cbfeabcf726c707 | [
"BSD-3-Clause"
] | null | null | null | """Test converting an image to a pyramid.
"""
import numpy as np
import napari
points = np.random.randint(100, size=(50_000, 2))
with napari.gui_qt():
viewer = napari.view_points(points, face_color='red')
| 19.272727 | 57 | 0.712264 |
import numpy as np
import napari
points = np.random.randint(100, size=(50_000, 2))
with napari.gui_qt():
viewer = napari.view_points(points, face_color='red')
| true | true |
f72d96f6423727aab809d5f6a13928f7eb8bc3a9 | 789 | py | Python | starting/10-Functions_variables_scope.py | souzartn/Python2Share | ef22c3b40f82455d40e512e5dd6de1c98e7100bc | [
"MIT"
] | 2 | 2020-01-11T19:58:11.000Z | 2020-01-11T19:58:42.000Z | starting/10-Functions_variables_scope.py | souzartn/Python2Share | ef22c3b40f82455d40e512e5dd6de1c98e7100bc | [
"MIT"
] | null | null | null | starting/10-Functions_variables_scope.py | souzartn/Python2Share | ef22c3b40f82455d40e512e5dd6de1c98e7100bc | [
"MIT"
] | 2 | 2020-01-11T19:58:51.000Z | 2020-01-11T19:58:51.000Z | #Here we define "x" global variable and assign a value to it
x=10
y=200
print('the value of x global variable is {0}'.format(x))
#Here define function "MyFunction", it takes no paraments
def MyFunction():
global y # this is the same global variable "y"
x=2 #This is a local variable, unrelated to "x" global ... | 39.45 | 87 | 0.709759 | x=10
y=200
print('the value of x global variable is {0}'.format(x))
def MyFunction():
global y x=2 print('the value of x local variable (inside MyFunction) is {0}'.format(x))
y=300
print('the value of y global variable (inside MyFunction) is {0}'.format(y))
print('starting program...')
MyFunctio... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.