hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79077364150e9401f096da60497a80960ce1bc89 | 12,938 | py | Python | category_encoders/count.py | JoshuaC3/categorical-encoding | 169aaeb26b96c264c82fd2bc7eedff75f2b91ae5 | [
"BSD-3-Clause"
] | null | null | null | category_encoders/count.py | JoshuaC3/categorical-encoding | 169aaeb26b96c264c82fd2bc7eedff75f2b91ae5 | [
"BSD-3-Clause"
] | null | null | null | category_encoders/count.py | JoshuaC3/categorical-encoding | 169aaeb26b96c264c82fd2bc7eedff75f2b91ae5 | [
"BSD-3-Clause"
] | null | null | null | """Count Encoder"""
import numpy as np
import pandas as pd
import category_encoders.utils as util
from copy import copy
from sklearn.base import BaseEstimator, TransformerMixin
__author__ = 'joshua t. dunn'
class CountEncoder(BaseEstimator, TransformerMixin):
def __init__(self, verbose=0, cols=None, drop_invar... | 36.139665 | 93 | 0.541738 | import numpy as np
import pandas as pd
import category_encoders.utils as util
from copy import copy
from sklearn.base import BaseEstimator, TransformerMixin
__author__ = 'joshua t. dunn'
class CountEncoder(BaseEstimator, TransformerMixin):
def __init__(self, verbose=0, cols=None, drop_invariant=False,
... | true | true |
790774071b5e09178748078702b5453337cd49f7 | 1,664 | py | Python | P5/Brasilia/Q7 - BR.py | Boa-Thomas/Eletricidade | 7cbd62f2d56cbb1430ed0b8818ffc878b480b3c1 | [
"MIT"
] | null | null | null | P5/Brasilia/Q7 - BR.py | Boa-Thomas/Eletricidade | 7cbd62f2d56cbb1430ed0b8818ffc878b480b3c1 | [
"MIT"
] | null | null | null | P5/Brasilia/Q7 - BR.py | Boa-Thomas/Eletricidade | 7cbd62f2d56cbb1430ed0b8818ffc878b480b3c1 | [
"MIT"
] | 2 | 2022-02-16T00:08:07.000Z | 2022-03-07T13:43:37.000Z | import cmath
import math
cv =150
cvconv = 736
t1 =440
t2 = 254
polos = 10
freq = 60
r1 = 0.012
R2L = 0.018
X1 = 0.08
X2L = X1
Rp = 58
Xm = 54
print("\nConsidere que o motor é alimentado com tensão de fase igual a 254 V, conexão Y e atinge escorregamento igual a 1,8%")
print("\nA - Corrente no estator\n")
s = 0.018
p... | 17.333333 | 126 | 0.582933 | import cmath
import math
cv =150
cvconv = 736
t1 =440
t2 = 254
polos = 10
freq = 60
r1 = 0.012
R2L = 0.018
X1 = 0.08
X2L = X1
Rp = 58
Xm = 54
print("\nConsidere que o motor é alimentado com tensão de fase igual a 254 V, conexão Y e atinge escorregamento igual a 1,8%")
print("\nA - Corrente no estator\n")
s = 0.018
p... | true | true |
790776b7ac11feed73af6aae9673f127ed003258 | 1,113 | py | Python | examples/hacker_news/setup.py | kbd/dagster | 14affaf1372fcb5169e6c2d5d53621eeed954767 | [
"Apache-2.0"
] | null | null | null | examples/hacker_news/setup.py | kbd/dagster | 14affaf1372fcb5169e6c2d5d53621eeed954767 | [
"Apache-2.0"
] | null | null | null | examples/hacker_news/setup.py | kbd/dagster | 14affaf1372fcb5169e6c2d5d53621eeed954767 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="hacker_news",
version="dev",
author="Elementl",
author_email="hello@elementl.com",
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"... | 26.5 | 66 | 0.539982 | from setuptools import find_packages, setup
setup(
name="hacker_news",
version="dev",
author="Elementl",
author_email="hello@elementl.com",
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8"... | true | true |
790776caca4bebab86893c741e794ed61cf7a24c | 16,245 | py | Python | bmtk/utils/reports/spike_trains/plotting.py | mjhyman/bmtk | 42dcce944fe8ff8cab02b19d2d983f73a8cbc0d1 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T23:02:05.000Z | 2020-08-12T23:02:05.000Z | bmtk/utils/reports/spike_trains/plotting.py | mjhyman/bmtk | 42dcce944fe8ff8cab02b19d2d983f73a8cbc0d1 | [
"BSD-3-Clause"
] | null | null | null | bmtk/utils/reports/spike_trains/plotting.py | mjhyman/bmtk | 42dcce944fe8ff8cab02b19d2d983f73a8cbc0d1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2020. Allen Institute. All rights reserved
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow... | 47.639296 | 120 | 0.697999 |
import numpy as np
import six
import matplotlib.pyplot as plt
import types
import copy
from functools import partial
from .spike_trains import SpikeTrains
from .spike_trains_api import SpikeTrainsAPI
def __get_spike_trains(spike_trains):
if isinstance(spike_trains, six.string_types):
... | true | true |
7907797d313be675a9fff120b60dc370985e5f44 | 1,662 | py | Python | tests/search_filter/test_search_filter_service.py | ymatsiuk/dispatch | cfc0b238f980d9f8140294dd50a5527ca4e1cdb8 | [
"Apache-2.0"
] | null | null | null | tests/search_filter/test_search_filter_service.py | ymatsiuk/dispatch | cfc0b238f980d9f8140294dd50a5527ca4e1cdb8 | [
"Apache-2.0"
] | null | null | null | tests/search_filter/test_search_filter_service.py | ymatsiuk/dispatch | cfc0b238f980d9f8140294dd50a5527ca4e1cdb8 | [
"Apache-2.0"
] | null | null | null | import pytest
def test_get(session, search_filter):
from dispatch.search_filter.service import get
t_search_filter = get(db_session=session, search_filter_id=search_filter.id)
assert t_search_filter.id == search_filter.id
def test_get_all(session, search_filters):
from dispatch.search_filter.servic... | 27.245902 | 81 | 0.737665 | import pytest
def test_get(session, search_filter):
from dispatch.search_filter.service import get
t_search_filter = get(db_session=session, search_filter_id=search_filter.id)
assert t_search_filter.id == search_filter.id
def test_get_all(session, search_filters):
from dispatch.search_filter.servic... | true | true |
79077ab9eea1593a9c9e072b1c42a4cabb1739dc | 6,323 | py | Python | test/test_regex.py | clayne/asm2cfg | 4d9089185ec8efb0bf82aa525762f5af84cc0c6d | [
"MIT"
] | null | null | null | test/test_regex.py | clayne/asm2cfg | 4d9089185ec8efb0bf82aa525762f5af84cc0c6d | [
"MIT"
] | null | null | null | test/test_regex.py | clayne/asm2cfg | 4d9089185ec8efb0bf82aa525762f5af84cc0c6d | [
"MIT"
] | null | null | null | """
Unittests of asm2cfg's regexes
"""
import unittest
from src.asm2cfg import asm2cfg
class FunctionHeaderTestCase(unittest.TestCase):
"""
Tests of function header regex
"""
def test_gdb_unstripped(self):
line = 'Dump of assembler code for function test_function:'
fmt, fun = asm2cf... | 32.425641 | 78 | 0.652697 |
import unittest
from src.asm2cfg import asm2cfg
class FunctionHeaderTestCase(unittest.TestCase):
def test_gdb_unstripped(self):
line = 'Dump of assembler code for function test_function:'
fmt, fun = asm2cfg.parse_function_header(line)
self.assertEqual(fmt, asm2cfg.InputFormat.GDB)
... | true | true |
79077b00bc0523eae654fd0035bda44d3a761054 | 402 | py | Python | return_practice.py | Athenian-ComputerScience-Fall2020/functions-practice-21lsparks | dd772a336d18f2c7736a72080111271aed181d48 | [
"Apache-2.0"
] | null | null | null | return_practice.py | Athenian-ComputerScience-Fall2020/functions-practice-21lsparks | dd772a336d18f2c7736a72080111271aed181d48 | [
"Apache-2.0"
] | 1 | 2020-09-29T03:31:49.000Z | 2020-09-29T03:31:49.000Z | return_practice.py | Athenian-ComputerScience-Fall2020/functions-practice-21lsparks | dd772a336d18f2c7736a72080111271aed181d48 | [
"Apache-2.0"
] | null | null | null | # Add comments to explain what the output from this program will be and how you know.
def math1():
num1 = 50
num2 = 5
return num1 + num2
def math2():
num1 = 50
num2 = 5
return num1 - num2
def math3():
num1 = 50
num2 = 5
return num1 * num2
output_num = math2()
print(output_num)
'''
Add pr... | 15.461538 | 85 | 0.639303 |
def math1():
num1 = 50
num2 = 5
return num1 + num2
def math2():
num1 = 50
num2 = 5
return num1 - num2
def math3():
num1 = 50
num2 = 5
return num1 * num2
output_num = math2()
print(output_num)
| true | true |
79077b92015bbceb91ab6b6fbe7fc577c35eb1ed | 5,848 | py | Python | radiator_fritz_o365_sync/core.py | ykorzikowski/python-fritz-office-365-sync | 2044aa3d6cbdf9ceddd82f96380336ad2addb6f4 | [
"Apache-2.0"
] | 1 | 2019-06-10T18:16:15.000Z | 2019-06-10T18:16:15.000Z | radiator_fritz_o365_sync/core.py | ykorzikowski/python-fritz-office-365-sync | 2044aa3d6cbdf9ceddd82f96380336ad2addb6f4 | [
"Apache-2.0"
] | null | null | null | radiator_fritz_o365_sync/core.py | ykorzikowski/python-fritz-office-365-sync | 2044aa3d6cbdf9ceddd82f96380336ad2addb6f4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from O365 import Account, Connection, FileSystemTokenBackend
from datetime import datetime as dt
from datetime import timedelta
from conf.conf import CONFIG as conf
from fritzhome import FritzBox
import logging
class Core:
@staticmethod
def get_credentials():
return... | 35.658537 | 146 | 0.632695 |
import os
from O365 import Account, Connection, FileSystemTokenBackend
from datetime import datetime as dt
from datetime import timedelta
from conf.conf import CONFIG as conf
from fritzhome import FritzBox
import logging
class Core:
@staticmethod
def get_credentials():
return conf['OFFICE_CLIENT_ID... | true | true |
79077b96ce06cb88bebec2f7bc5e8bffdea9380b | 2,581 | py | Python | twitoff/app.py | kvinne-anc/TwittOff | f734323edc9f271f81c217f2cf6e9afdccf964dc | [
"MIT"
] | null | null | null | twitoff/app.py | kvinne-anc/TwittOff | f734323edc9f271f81c217f2cf6e9afdccf964dc | [
"MIT"
] | null | null | null | twitoff/app.py | kvinne-anc/TwittOff | f734323edc9f271f81c217f2cf6e9afdccf964dc | [
"MIT"
] | null | null | null | """Main app/routing file for TwitOff"""
from os import getenv
from flask import Flask, render_template, request
from twitoff.twitter import add_or_update_user
from twitoff.models import DB, User, MIGRATE
from twitoff.predict import predict_user
def create_app():
app = Flask(__name__)
app.config["SQLALCHEMY_D... | 33.519481 | 103 | 0.618752 | from os import getenv
from flask import Flask, render_template, request
from twitoff.twitter import add_or_update_user
from twitoff.models import DB, User, MIGRATE
from twitoff.predict import predict_user
def create_app():
app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = getenv("DATABASE_URL")
... | true | true |
79077beb055c458d395199ff41e16e906d53d08c | 1,272 | py | Python | hdfshell/cluster.py | alingse/hdfshell | 3da0ff9fd2204fd957f011fe6fd3e21687004c7c | [
"Apache-2.0"
] | null | null | null | hdfshell/cluster.py | alingse/hdfshell | 3da0ff9fd2204fd957f011fe6fd3e21687004c7c | [
"Apache-2.0"
] | null | null | null | hdfshell/cluster.py | alingse/hdfshell | 3da0ff9fd2204fd957f011fe6fd3e21687004c7c | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
#author@alingse
#2016.06.21
hdfs_schema = 'hdfs://'
file_schema = 'file://'
class hdfsCluster(object):
""" 一个hdfs 资源 hdfs uri,path,账户密码认证
"""
def __init__(self,host,port=9000,schema=hdfs_schema):
""" 目前只需要host和port """
self.host = host
self.port = port
self.... | 20.852459 | 77 | 0.552673 |
hdfs_schema = 'hdfs://'
file_schema = 'file://'
class hdfsCluster(object):
def __init__(self,host,port=9000,schema=hdfs_schema):
self.host = host
self.port = port
self.schema = schema
self._path = '/'
self._status = None
@property
def status(self):
... | true | true |
79077c49d4fd877106e3bb12a28b786be0f3b587 | 6,831 | py | Python | dqn/exercise/dqn_agent.py | 0xtristan/deep-reinforcement-learning | fb943ddb2796d85cc876ea076a26d850b7b87919 | [
"MIT"
] | 1 | 2019-08-10T04:01:22.000Z | 2019-08-10T04:01:22.000Z | dqn/exercise/dqn_agent.py | tfrizza/deep-reinforcement-learning | fb943ddb2796d85cc876ea076a26d850b7b87919 | [
"MIT"
] | null | null | null | dqn/exercise/dqn_agent.py | tfrizza/deep-reinforcement-learning | fb943ddb2796d85cc876ea076a26d850b7b87919 | [
"MIT"
] | 1 | 2021-11-14T17:29:39.000Z | 2021-11-14T17:29:39.000Z | import numpy as np
import random
from collections import namedtuple, deque
from model import QNetwork
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5) # replay buffer size
BATCH_SIZE = 64 # minibatch size
GAMMA = 0.99 # discount factor
TAU = 1e-3 ... | 41.652439 | 127 | 0.624799 | import numpy as np
import random
from collections import namedtuple, deque
from model import QNetwork
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e5)
BATCH_SIZE = 64
GAMMA = 0.99
TAU = 1e-3
LR = 5e-4
UPDATE_EVERY = 4 ... | true | true |
79077d4b3595c987921374a8110da69527eb0df1 | 1,080 | py | Python | palindrome_check.py | igelfiend/Python.Structures.Deque | 4d296615ab1a4c5d7fd4af03164228cb877a0d00 | [
"MIT"
] | null | null | null | palindrome_check.py | igelfiend/Python.Structures.Deque | 4d296615ab1a4c5d7fd4af03164228cb877a0d00 | [
"MIT"
] | null | null | null | palindrome_check.py | igelfiend/Python.Structures.Deque | 4d296615ab1a4c5d7fd4af03164228cb877a0d00 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf8
from copy import deepcopy
class Deque:
def __init__(self):
self.data = []
def addFront(self, item):
self.data.insert(0, item)
def addTail(self, item):
self.data.append(item)
def removeFront(self):
if self.size() == 0:
... | 21.6 | 72 | 0.564815 |
from copy import deepcopy
class Deque:
def __init__(self):
self.data = []
def addFront(self, item):
self.data.insert(0, item)
def addTail(self, item):
self.data.append(item)
def removeFront(self):
if self.size() == 0:
return None
else:
... | true | true |
79077e267dd746d28e22773af26b462a9124a50a | 1,459 | py | Python | docs/tokenizer.py | concreted/prefect | dd732f5990ee2b0f3d816adb285168fd63b239e4 | [
"Apache-2.0"
] | 8,633 | 2019-03-23T17:51:03.000Z | 2022-03-31T22:17:42.000Z | docs/tokenizer.py | concreted/prefect | dd732f5990ee2b0f3d816adb285168fd63b239e4 | [
"Apache-2.0"
] | 3,903 | 2019-03-23T19:11:21.000Z | 2022-03-31T23:21:23.000Z | docs/tokenizer.py | ngriffiths13/prefect | 7f5613abcb182494b7dc12159277c3bc5f3c9898 | [
"Apache-2.0"
] | 937 | 2019-03-23T18:49:44.000Z | 2022-03-31T21:45:13.000Z | from pygments.lexers import Python3Lexer
from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, String
def is_comment(token):
return token in Comment
def is_decorator(token):
return token in Name.Decorator
def is_function(token):
return token in Name.Function
def is_builti... | 19.986301 | 88 | 0.663468 | from pygments.lexers import Python3Lexer
from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, String
def is_comment(token):
return token in Comment
def is_decorator(token):
return token in Name.Decorator
def is_function(token):
return token in Name.Function
def is_builti... | true | true |
79077e9bac0a3bae6b1a07981b053ed053545a65 | 7,146 | py | Python | test/test_spatial_interpolation.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | null | null | null | test/test_spatial_interpolation.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | 314 | 2020-02-26T12:37:17.000Z | 2021-08-02T00:32:32.000Z | test/test_spatial_interpolation.py | rgaensler/gcode | c6a6b617a04490dedefb2bae7b596a2e12ab4ab1 | [
"MIT"
] | 2 | 2020-11-12T16:07:48.000Z | 2020-11-16T09:14:48.000Z | from math import pi, sqrt
from typing import List
import numpy as np
import pytest
from src.kinematics.forward_kinematics import get_tform
from src.prechecks.spatial_interpolation import linear_interpolation, circular_interpolation
@pytest.mark.parametrize("start,end,ds,expected_points",
[
... | 47.64 | 110 | 0.34047 | from math import pi, sqrt
from typing import List
import numpy as np
import pytest
from src.kinematics.forward_kinematics import get_tform
from src.prechecks.spatial_interpolation import linear_interpolation, circular_interpolation
@pytest.mark.parametrize("start,end,ds,expected_points",
[
... | true | true |
79077f21d6d7384dc45eda0bee1e5a779573fae2 | 6,865 | py | Python | neuroswarms/matrix.py | jdmonaco/neuroswarms | a2bfaa4e9b84baecdb41e01a32a028665e8886d7 | [
"MIT"
] | 1 | 2020-11-19T11:37:26.000Z | 2020-11-19T11:37:26.000Z | neuroswarms/matrix.py | jdmonaco/neuroswarms | a2bfaa4e9b84baecdb41e01a32a028665e8886d7 | [
"MIT"
] | null | null | null | neuroswarms/matrix.py | jdmonaco/neuroswarms | a2bfaa4e9b84baecdb41e01a32a028665e8886d7 | [
"MIT"
] | 1 | 2020-11-19T11:38:15.000Z | 2020-11-19T11:38:15.000Z | """
Matrix operations for neuroswarms models.
Author: Joseph Monaco (jmonaco@jhu.edu)
Affiliation: Johns Hopkins University
Created: 2019-05-12
Updated: 2020-11-16
Related paper:
Monaco, J.D., Hwang, G.M., Schultz, K.M. et al. Cognitive swarming in complex
environments with attractor dynamics and oscillatory... | 30.376106 | 81 | 0.621267 |
__all__ = ('tile_index', 'pairwise_tile_index', 'pairwise_distances',
'distances', 'pairwise_phasediffs', 'pairwise_unit_diffs',
'somatic_motion_update', 'reward_motion_update')
from numpy import (empty, zeros, newaxis as AX, swapaxes, hypot, sin, inf,
broadcast_arrays, broadcast_to)
fr... | true | true |
790780152dc5b7c65e4a1d012f8ebe7d99bb2a51 | 7,288 | py | Python | azure-ml-pipelines/pytorch/training-folder/pytorch_train.py | hudua/azureml | 51f67380aa773184ef1710a3983ce017c29e68e8 | [
"MIT"
] | null | null | null | azure-ml-pipelines/pytorch/training-folder/pytorch_train.py | hudua/azureml | 51f67380aa773184ef1710a3983ce017c29e68e8 | [
"MIT"
] | null | null | null | azure-ml-pipelines/pytorch/training-folder/pytorch_train.py | hudua/azureml | 51f67380aa773184ef1710a3983ce017c29e68e8 | [
"MIT"
] | null | null | null |
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import datasets, models, transforms
import numpy as np
import time
import os
import copy
import argparse
from azureml.core.run import Run
from azureml.co... | 34.215962 | 119 | 0.612514 |
from __future__ import print_function, division
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torchvision import datasets, models, transforms
import numpy as np
import time
import os
import copy
import argparse
from azureml.core.run import Run
from azureml.co... | true | true |
79078052b865175debedebdc36758824b94e71f2 | 15,667 | py | Python | dns_main/src/kinematics.py | JevgenijsGalaktionovs/AntBot | e89fa811087cce6c4038329c44ffeaf26308c0e9 | [
"MIT"
] | null | null | null | dns_main/src/kinematics.py | JevgenijsGalaktionovs/AntBot | e89fa811087cce6c4038329c44ffeaf26308c0e9 | [
"MIT"
] | 4 | 2019-09-10T07:14:06.000Z | 2019-09-10T09:29:51.000Z | dns_main/src/kinematics.py | eugenegalaxy/DNS | e89fa811087cce6c4038329c44ffeaf26308c0e9 | [
"MIT"
] | null | null | null | # !/usr/bin/env python2
from math import pi, cos, sin, atan2, acos, sqrt, pow, radians, asin
from math_calc import *
from service_router import readPos
class LegConsts(object):
''' Class object to store characteristics of each leg '''
def __init__(self, x_off, y_off, z_off, ang_off, leg_nr):
self.x_of... | 47.048048 | 203 | 0.547456 |
from math import pi, cos, sin, atan2, acos, sqrt, pow, radians, asin
from math_calc import *
from service_router import readPos
class LegConsts(object):
''' Class object to store characteristics of each leg '''
def __init__(self, x_off, y_off, z_off, ang_off, leg_nr):
self.x_off = x_off ... | false | true |
79078066b6af069c242f862f323f0ed337449d6a | 7,787 | py | Python | rasa/shared/importers/multi_project.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | null | null | null | rasa/shared/importers/multi_project.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | null | null | null | rasa/shared/importers/multi_project.py | mukulbalodi/rasa | 3126ef1148c165f2402f3c7203138d429e46c68c | [
"Apache-2.0"
] | 1 | 2022-02-22T12:35:19.000Z | 2022-02-22T12:35:19.000Z | import logging
from functools import reduce
from typing import Text, Set, Dict, Optional, List, Union, Any
import os
import rasa.shared.data
import rasa.shared.utils.io
from rasa.shared.core.domain import Domain
from rasa.shared.importers.importer import TrainingDataImporter
from rasa.shared.importers import utils
fro... | 38.549505 | 88 | 0.651856 | import logging
from functools import reduce
from typing import Text, Set, Dict, Optional, List, Union, Any
import os
import rasa.shared.data
import rasa.shared.utils.io
from rasa.shared.core.domain import Domain
from rasa.shared.importers.importer import TrainingDataImporter
from rasa.shared.importers import utils
fro... | true | true |
7907806716c8beba0182bfd72e0f656cf99a49b1 | 346 | py | Python | chat_app/routing.py | aanu1143/chat-app | 20ce2d08ba1efea8951fb9db920014589789a2d9 | [
"MIT"
] | null | null | null | chat_app/routing.py | aanu1143/chat-app | 20ce2d08ba1efea8951fb9db920014589789a2d9 | [
"MIT"
] | null | null | null | chat_app/routing.py | aanu1143/chat-app | 20ce2d08ba1efea8951fb9db920014589789a2d9 | [
"MIT"
] | null | null | null | from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import chat.routing
application = ProtocolTypeRouter({
# Empty for now (http->django views is added by default)
'websocket': AuthMiddlewareStack(
URLRouter(
chat.routing.websocket_urlpa... | 26.615385 | 60 | 0.722543 | from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import chat.routing
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRouter(
chat.routing.websocket_urlpatterns
)
),
}) | true | true |
790780cefe04d8b106ea68eb55ca71ae2365469e | 372 | py | Python | example/save_and_load_model.py | wingedsheep/music-generation-tools | 02656eb75781925451f51d4ead7d8b6003bdeb29 | [
"MIT"
] | 12 | 2021-07-22T12:13:27.000Z | 2022-02-13T09:09:08.000Z | example/save_and_load_model.py | wingedsheep/music-generation-tools | 02656eb75781925451f51d4ead7d8b6003bdeb29 | [
"MIT"
] | 9 | 2021-06-26T10:43:16.000Z | 2021-12-03T17:25:10.000Z | example/save_and_load_model.py | wingedsheep/music-generation-tools | 02656eb75781925451f51d4ead7d8b6003bdeb29 | [
"MIT"
] | null | null | null | from mgt.datamanagers.remi.dictionary_generator import DictionaryGenerator
from mgt.models.transformer_model import TransformerModel
"""
Example showing how to save and load a model.
"""
dictionary = DictionaryGenerator.create_dictionary();
model = TransformerModel(dictionary)
model.save_checkpoint("test_model")
mode... | 31 | 74 | 0.833333 | from mgt.datamanagers.remi.dictionary_generator import DictionaryGenerator
from mgt.models.transformer_model import TransformerModel
dictionary = DictionaryGenerator.create_dictionary();
model = TransformerModel(dictionary)
model.save_checkpoint("test_model")
model2 = TransformerModel.load_checkpoint("test_model")
| true | true |
7907817491ff57d46ad146b73c73dd0cd9632333 | 2,481 | py | Python | test_geo.py | negsrahimi/monke | ec2c953c6f10103eb2b45dc68160246a6ee5a473 | [
"MIT"
] | null | null | null | test_geo.py | negsrahimi/monke | ec2c953c6f10103eb2b45dc68160246a6ee5a473 | [
"MIT"
] | null | null | null | test_geo.py | negsrahimi/monke | ec2c953c6f10103eb2b45dc68160246a6ee5a473 | [
"MIT"
] | null | null | null | """Tests for functions defined in the floodsystem/geo module
"""
from floodsystem import geo
from floodsystem.station import MonitoringStation
from floodsystem.stationdata import build_station_list
stations = build_station_list()
# define arbitrary stations for the tests
station_id1 = "test station id 1"
measure_id... | 34.943662 | 128 | 0.742846 |
from floodsystem import geo
from floodsystem.station import MonitoringStation
from floodsystem.stationdata import build_station_list
stations = build_station_list()
station_id1 = "test station id 1"
measure_id1 = "test measure id 1"
label1 = "TS1"
coord1 = (1.0, 4.0)
typical_range1 = (-2, 5)
river1 = "River Cam"
t... | true | true |
7907817eaace07c51f5c20363c1fda57e0c57fc3 | 1,191 | py | Python | src/utils/console_functions.py | MariusDgr/AudioMining | ef74567fcc1d9034777bde45bc4a4ead20e8aa75 | [
"Apache-2.0"
] | null | null | null | src/utils/console_functions.py | MariusDgr/AudioMining | ef74567fcc1d9034777bde45bc4a4ead20e8aa75 | [
"Apache-2.0"
] | null | null | null | src/utils/console_functions.py | MariusDgr/AudioMining | ef74567fcc1d9034777bde45bc4a4ead20e8aa75 | [
"Apache-2.0"
] | null | null | null | # Print iterations progress
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', printEnd = "\r"):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : tota... | 47.64 | 123 | 0.592779 |
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', printEnd = "\r"):
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total)))
filledLength = int(length * iteration // total)
bar = fill * filledLength + '-' * (length - filledLe... | true | true |
790781e3fabc371efb85b5a430d9dced823cd5d5 | 922 | py | Python | data_loader.py | abhishek1907/transformer | 49693c47c6e2550bd85d60604dd8319cd761d816 | [
"MIT"
] | null | null | null | data_loader.py | abhishek1907/transformer | 49693c47c6e2550bd85d60604dd8319cd761d816 | [
"MIT"
] | null | null | null | data_loader.py | abhishek1907/transformer | 49693c47c6e2550bd85d60604dd8319cd761d816 | [
"MIT"
] | null | null | null | from torchtext import data
import spacy
import dill
BOS_WORD = '<s>'
EOS_WORD = '</s>'
BLANK_WORD = "<blank>"
spacy_en = spacy.load('en')
spacy_de = spacy.load('de')
def tokenizer_en(text):
return [tok.text for tok in spacy_en.tokenizer(text)]
def tokenizer_de(text):
return [tok.text for tok in spacy_de.tok... | 28.8125 | 170 | 0.715835 | from torchtext import data
import spacy
import dill
BOS_WORD = '<s>'
EOS_WORD = '</s>'
BLANK_WORD = "<blank>"
spacy_en = spacy.load('en')
spacy_de = spacy.load('de')
def tokenizer_en(text):
return [tok.text for tok in spacy_en.tokenizer(text)]
def tokenizer_de(text):
return [tok.text for tok in spacy_de.tok... | true | true |
790782d1c21f4f039013903d7f863d124c97cdc5 | 472 | py | Python | misc/configuration/config.py | gotitinc/code-samples | 78f4a42b7ea3826d84b91d7303c41da3458d75de | [
"Apache-2.0"
] | null | null | null | misc/configuration/config.py | gotitinc/code-samples | 78f4a42b7ea3826d84b91d7303c41da3458d75de | [
"Apache-2.0"
] | null | null | null | misc/configuration/config.py | gotitinc/code-samples | 78f4a42b7ea3826d84b91d7303c41da3458d75de | [
"Apache-2.0"
] | null | null | null | import os.path
from importlib import import_module
basedir = os.path.abspath(os.path.dirname(__file__))
env = os.getenv('ENVIRONMENT', 'local')
if not env in ['local', 'test']:
config_file = '/path/to/config/directory/' + env + '.py'
if not os.path.isfile(config_file):
env = 'local'
config_name = 'pat... | 27.764706 | 60 | 0.709746 | import os.path
from importlib import import_module
basedir = os.path.abspath(os.path.dirname(__file__))
env = os.getenv('ENVIRONMENT', 'local')
if not env in ['local', 'test']:
config_file = '/path/to/config/directory/' + env + '.py'
if not os.path.isfile(config_file):
env = 'local'
config_name = 'pat... | true | true |
7907843f53aebe2d388e8a228811273446d764aa | 2,292 | py | Python | tms/breakrule.py | marmstr93ng/TimeManagementSystem | 2f81ea33d9bd9415151215143e7f9ad55704dd95 | [
"MIT"
] | null | null | null | tms/breakrule.py | marmstr93ng/TimeManagementSystem | 2f81ea33d9bd9415151215143e7f9ad55704dd95 | [
"MIT"
] | 12 | 2018-09-27T09:47:21.000Z | 2021-06-01T22:34:22.000Z | tms/breakrule.py | marmstr93ng/TimeManagementSystemEmulator | 2f81ea33d9bd9415151215143e7f9ad55704dd95 | [
"MIT"
] | null | null | null | import logging
import configparser
import os
from utils import bool_query
class BreakRule(object):
def __init__(self, settings):
self.settings = settings
self.rules_record = configparser.ConfigParser()
self.rules_record.read("{}/tms/breakrules.ini".format(os.getcwd()))
self.rules... | 37.57377 | 108 | 0.616492 | import logging
import configparser
import os
from utils import bool_query
class BreakRule(object):
def __init__(self, settings):
self.settings = settings
self.rules_record = configparser.ConfigParser()
self.rules_record.read("{}/tms/breakrules.ini".format(os.getcwd()))
self.rules... | true | true |
7907846247f0f03b6ff0972b2b828280e46f807c | 928 | py | Python | src/client_py/olist.py | epmcj/nextflix | de15f0a63fe8906a0417da675b9a1c408f71bc79 | [
"MIT"
] | null | null | null | src/client_py/olist.py | epmcj/nextflix | de15f0a63fe8906a0417da675b9a1c408f71bc79 | [
"MIT"
] | null | null | null | src/client_py/olist.py | epmcj/nextflix | de15f0a63fe8906a0417da675b9a1c408f71bc79 | [
"MIT"
] | null | null | null | class OrderedList:
def __init__(self, unique=False):
self.list = []
self.__unique = unique
def add(self, value):
i = 0
while (i < len(self.list)) and (self.list[i] < value):
i += 1
if self.__unique:
if len(self.list) == i or self.list[i] != va... | 25.081081 | 62 | 0.501078 | class OrderedList:
def __init__(self, unique=False):
self.list = []
self.__unique = unique
def add(self, value):
i = 0
while (i < len(self.list)) and (self.list[i] < value):
i += 1
if self.__unique:
if len(self.list) == i or self.list[i] != va... | true | true |
7907846fe820f0323c6f7d08edf0ea83ee22e584 | 3,020 | py | Python | vendor-local/src/django-extensions/django_extensions/db/fields/json.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 22 | 2015-01-16T01:36:32.000Z | 2020-06-08T00:46:18.000Z | vendor-local/src/django-extensions/django_extensions/db/fields/json.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 267 | 2015-01-01T00:18:57.000Z | 2015-10-14T00:01:13.000Z | vendor-local/src/django-extensions/django_extensions/db/fields/json.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 13 | 2015-01-13T20:56:22.000Z | 2022-02-23T06:01:17.000Z | """
JSONField automatically serializes most Python terms to JSON data.
Creates a TEXT field with a default value of "{}". See test_json.py for
more information.
from django.db import models
from django_extensions.db.fields import json
class LOL(models.Model):
extra = json.JSONField()
"""
import datetime
fro... | 29.607843 | 85 | 0.636755 |
import datetime
from decimal import Decimal
from django.db import models
from django.conf import settings
from django.utils import simplejson
from django.utils.encoding import smart_unicode
class JSONEncoder(simplejson.JSONEncoder):
def default(self, obj):
if isinstance(obj, Decimal):
return ... | true | true |
790784fd50a217bc4c8ef7e4d9578ad17a1edc59 | 4,328 | py | Python | show/plugins/mlnx.py | chaoskao/sonic-utilities | 47a9a0f56db95265c15c74c4c8dc6a3998bfd2d3 | [
"Apache-2.0"
] | 1 | 2021-02-03T06:28:38.000Z | 2021-02-03T06:28:38.000Z | show/plugins/mlnx.py | chaoskao/sonic-utilities | 47a9a0f56db95265c15c74c4c8dc6a3998bfd2d3 | [
"Apache-2.0"
] | 5 | 2020-02-27T09:19:52.000Z | 2021-05-24T16:04:51.000Z | show/plugins/mlnx.py | chaoskao/sonic-utilities | 47a9a0f56db95265c15c74c4c8dc6a3998bfd2d3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# main.py
#
# Specific command-line utility for Mellanox platform
#
try:
import sys
import subprocess
import click
import xml.etree.ElementTree as ET
from sonic_py_common import device_info
except ImportError as e:
raise ImportError("%s - required module not found" % st... | 29.643836 | 98 | 0.69085 |
try:
import sys
import subprocess
import click
import xml.etree.ElementTree as ET
from sonic_py_common import device_info
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
ENV_VARIABLE_SX_SNIFFER = 'SX_SNIFFER_ENABLE'
CONTAINER_NAME = 'syncd'
SNIFFER_C... | true | true |
79078562da997314e044513a049f2fa405083a7b | 1,216 | py | Python | test/test_del_contact_from_group.py | vatanov/python_training | 884a6fc08a7d2130e45dcf7850b2ff3a30f50bf7 | [
"Apache-2.0"
] | null | null | null | test/test_del_contact_from_group.py | vatanov/python_training | 884a6fc08a7d2130e45dcf7850b2ff3a30f50bf7 | [
"Apache-2.0"
] | null | null | null | test/test_del_contact_from_group.py | vatanov/python_training | 884a6fc08a7d2130e45dcf7850b2ff3a30f50bf7 | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
from model.group import Group
import random
def test_add_contact_in_group(app, db):
if app.contact.count() == 0:
app.contact.create_new(Contact(firstname="Contact for deletion", middlename="some middlename", lastname="some last name"))
if len(app.group.get_group_list(... | 36.848485 | 130 | 0.697368 | from model.contact import Contact
from model.group import Group
import random
def test_add_contact_in_group(app, db):
if app.contact.count() == 0:
app.contact.create_new(Contact(firstname="Contact for deletion", middlename="some middlename", lastname="some last name"))
if len(app.group.get_group_list(... | true | true |
7907866e030247e6434c8bb6a162224af0e779c6 | 289 | py | Python | efax/_src/samplable.py | NeilGirdhar/efax | 3a0f1ea3fafb456b024137dc5a20a9e7f9806a9f | [
"MIT"
] | 34 | 2020-03-24T06:21:08.000Z | 2022-03-19T04:48:17.000Z | efax/_src/samplable.py | NeilGirdhar/efax | 3a0f1ea3fafb456b024137dc5a20a9e7f9806a9f | [
"MIT"
] | 8 | 2020-03-30T11:27:48.000Z | 2021-07-05T06:10:06.000Z | efax/_src/samplable.py | NeilGirdhar/efax | 3a0f1ea3fafb456b024137dc5a20a9e7f9806a9f | [
"MIT"
] | 1 | 2022-03-17T01:34:07.000Z | 2022-03-17T01:34:07.000Z | from typing import Optional
from tjax import Array, Generator, Shape
from .parametrization import Parametrization
__all__ = ['Samplable']
class Samplable(Parametrization):
def sample(self, rng: Generator, shape: Optional[Shape] = None) -> Array:
raise NotImplementedError
| 22.230769 | 77 | 0.754325 | from typing import Optional
from tjax import Array, Generator, Shape
from .parametrization import Parametrization
__all__ = ['Samplable']
class Samplable(Parametrization):
def sample(self, rng: Generator, shape: Optional[Shape] = None) -> Array:
raise NotImplementedError
| true | true |
790786c0bb0eddc0e2979ef07022a6b74817db71 | 2,443 | py | Python | classiPi.py | yagyapandeya/Sound-classification-on-Raspberry-Pi-with-Tensorflow | 47450ade902c3d7127901565cc2d74d5e5490854 | [
"MIT"
] | 89 | 2017-11-14T16:02:10.000Z | 2022-01-31T03:55:48.000Z | classiPi.py | yagyapandeya/Sound-classification-on-Raspberry-Pi-with-Tensorflow | 47450ade902c3d7127901565cc2d74d5e5490854 | [
"MIT"
] | 7 | 2018-06-24T12:36:16.000Z | 2021-08-18T07:35:58.000Z | classiPi.py | yagyapandeya/Sound-classification-on-Raspberry-Pi-with-Tensorflow | 47450ade902c3d7127901565cc2d74d5e5490854 | [
"MIT"
] | 33 | 2017-11-17T18:52:48.000Z | 2022-01-05T12:53:41.000Z |
import glob
import os
import librosa
import numpy as np
import tensorflow as tf
import sounddevice
from sklearn.preprocessing import StandardScaler
duration = 0.1 # seconds
sample_rate=44100
'''0 = air_conditioner
1 = car_horn
2 = children_playing
3 = dog_bark
4 = drilling
5 = engine_idling
6 = gun_shot
7 = jackha... | 28.08046 | 97 | 0.715104 |
import glob
import os
import librosa
import numpy as np
import tensorflow as tf
import sounddevice
from sklearn.preprocessing import StandardScaler
duration = 0.1
sample_rate=44100
'''0 = air_conditioner
1 = car_horn
2 = children_playing
3 = dog_bark
4 = drilling
5 = engine_idling
6 = gun_shot
7 = jackhammer
8 = ... | false | true |
7907873f6c2d0369175c3b733e8fd18def3435ce | 2,320 | py | Python | integration_tests/emukit/quadrature/test_vanilla_bq_loop.py | alexgessner/emukit | 355e26bb30edd772a81af2a1267c569d7f446d42 | [
"Apache-2.0"
] | 6 | 2019-06-02T21:23:27.000Z | 2020-02-17T09:46:30.000Z | integration_tests/emukit/quadrature/test_vanilla_bq_loop.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 4 | 2019-05-17T13:30:21.000Z | 2019-06-21T13:49:19.000Z | integration_tests/emukit/quadrature/test_vanilla_bq_loop.py | Tony-Chiong/emukit | a068c8d5e06b2ae8b038f67bf2e4f66c4d91651a | [
"Apache-2.0"
] | 1 | 2020-01-12T19:50:44.000Z | 2020-01-12T19:50:44.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import GPy
from emukit.quadrature.methods.vanilla_bq import VanillaBayesianQuadrature
from emukit.quadrature.loop.quadrature_loop import VanillaBayesianQuadratureLoop
from emukit.core.lo... | 41.428571 | 109 | 0.721121 |
import numpy as np
import GPy
from emukit.quadrature.methods.vanilla_bq import VanillaBayesianQuadrature
from emukit.quadrature.loop.quadrature_loop import VanillaBayesianQuadratureLoop
from emukit.core.loop.user_function import UserFunctionWrapper
from emukit.model_wrappers.gpy_quadrature_wrappers import Quadratu... | true | true |
79078834c7c05e76f0619d7c05cadcd8e87dba2a | 6,127 | py | Python | awrams/config/system/default.py | kaamilah/awra_cms | bbbb85ad8864e2c835926439acc1e6dabb137a97 | [
"NetCDF"
] | 20 | 2016-12-01T03:13:50.000Z | 2021-12-02T23:43:38.000Z | awrams/config/system/default.py | kaamilah/awra_cms | bbbb85ad8864e2c835926439acc1e6dabb137a97 | [
"NetCDF"
] | 2 | 2018-02-05T03:42:11.000Z | 2018-04-27T05:49:44.000Z | awrams/config/system/default.py | kaamilah/awra_cms | bbbb85ad8864e2c835926439acc1e6dabb137a97 | [
"NetCDF"
] | 22 | 2016-12-13T19:57:43.000Z | 2021-12-08T02:52:19.000Z | from os.path import join
from awrams.utils.metatypes import objectify
import os
from logging import FATAL,CRITICAL,ERROR,WARNING,INFO,DEBUG
from awrams.utils.awrams_log import APPEND_FILE,TIMESTAMPED_FILE,ROTATED_SIZED_FILE,DAILY_ROTATED_FILE
from awrams.utils import config_manager
AWRAMS_BASE_PATH = str(config_manag... | 36.254438 | 120 | 0.593602 | from os.path import join
from awrams.utils.metatypes import objectify
import os
from logging import FATAL,CRITICAL,ERROR,WARNING,INFO,DEBUG
from awrams.utils.awrams_log import APPEND_FILE,TIMESTAMPED_FILE,ROTATED_SIZED_FILE,DAILY_ROTATED_FILE
from awrams.utils import config_manager
AWRAMS_BASE_PATH = str(config_manag... | true | true |
790788bf4117aba521c9c8636f84c4045f0d6178 | 915 | py | Python | OracleWebLogic/samples/12213-domain/container-scripts/add-machine.py | PfizerRD/oracle-docker | 348b8584aa53335601caded4f654f3722c591495 | [
"UPL-1.0"
] | null | null | null | OracleWebLogic/samples/12213-domain/container-scripts/add-machine.py | PfizerRD/oracle-docker | 348b8584aa53335601caded4f654f3722c591495 | [
"UPL-1.0"
] | null | null | null | OracleWebLogic/samples/12213-domain/container-scripts/add-machine.py | PfizerRD/oracle-docker | 348b8584aa53335601caded4f654f3722c591495 | [
"UPL-1.0"
] | null | null | null | #Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved.
#
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# Script to create and add NodeManager automatically to the domain's AdminServer running on '$ADMIN_HOST'.
#
# Since: October, 2014
# Aut... | 22.875 | 106 | 0.679781 |
#
# Since: October, 2014
# Author: bruno.borges@oracle.com
#
# =============================
import os
import socket
execfile('/u01/oracle/commonfuncs.py')
# NodeManager details
nmhost = os.environ.get('NM_HOST', socket.gethostbyname(hostname))
nmport = os.environ.get('NM_PORT', '5556')
# Connect to the AdminSe... | true | true |
79078927593b897acca8b25027f41844a3d328ad | 691 | py | Python | ginit.py | ghlmtz/airline-sim | 5899e0390aaa5792e0bc6b1673ad2f0b3dd11d1d | [
"MIT"
] | null | null | null | ginit.py | ghlmtz/airline-sim | 5899e0390aaa5792e0bc6b1673ad2f0b3dd11d1d | [
"MIT"
] | null | null | null | ginit.py | ghlmtz/airline-sim | 5899e0390aaa5792e0bc6b1673ad2f0b3dd11d1d | [
"MIT"
] | null | null | null | import timeit
mapx = 512
mapy = 512
# Good seeds:
# 772855 Spaced out continents
# 15213 Tight continents
# 1238 What I've been working with, for the most part
# 374539 Sparse continents
# 99999
seed = 773202
sea_level = 0.6
DEBUG = 0
GFXDEBUG = 0
setup_time = timeit.default_timer()
tiles = [[None] * mapx for _ in ... | 18.184211 | 53 | 0.677279 | import timeit
mapx = 512
mapy = 512
# 374539 Sparse continents
# 99999
seed = 773202
sea_level = 0.6
DEBUG = 0
GFXDEBUG = 0
setup_time = timeit.default_timer()
tiles = [[None] * mapx for _ in range(mapy)]
lands = []
towns = []
countries = []
have_savefile = False
class Clock():
def __init__(self,t):
self.ti... | true | true |
79078a1053c43f07eeaae1b829b4c69ed59c38c1 | 2,736 | py | Python | pipeline/filter.py | hadyelsahar/RE-NLG-Dataset | 460d52d50e5dc302cdd879f1435bda45a4946202 | [
"MIT"
] | 44 | 2018-03-05T00:40:30.000Z | 2022-03-21T04:44:09.000Z | pipeline/filter.py | hadyelsahar/RE-NLG-Dataset | 460d52d50e5dc302cdd879f1435bda45a4946202 | [
"MIT"
] | 4 | 2018-11-08T15:32:46.000Z | 2020-10-24T14:32:10.000Z | pipeline/filter.py | hadyelsahar/RE-NLG-Dataset | 460d52d50e5dc302cdd879f1435bda45a4946202 | [
"MIT"
] | 10 | 2018-01-23T00:30:39.000Z | 2021-11-08T03:24:25.000Z | from pipeline import *
class SentenceLimiter:
"""
Limit the text, word boundaries and
sentence boundaries of a given document
to the number of sentences given
"""
def run(self, document, number_sentences):
"""
:param: number_sentences, starts with 0 for the fist sentence
... | 35.076923 | 117 | 0.645468 | from pipeline import *
class SentenceLimiter:
def run(self, document, number_sentences):
boundaries = (document.sentences_boundaries[0][0], document.sentences_boundaries[:number_sentences+1][-1][1])
document.text = document.text[boundaries[0]:boundaries[1]]
document.sentences_boundaries = s... | true | true |
79078a8aa5b23cba43055803cf62956b0b6ca3bb | 25,006 | py | Python | app.py | SantiLJ/strategy-template | 28ec389a7ebac93e85e07b5310976bb08445f230 | [
"MIT"
] | null | null | null | app.py | SantiLJ/strategy-template | 28ec389a7ebac93e85e07b5310976bb08445f230 | [
"MIT"
] | null | null | null | app.py | SantiLJ/strategy-template | 28ec389a7ebac93e85e07b5310976bb08445f230 | [
"MIT"
] | null | null | null | # Fetches and displays a basic candlestick app.
import dash
import plotly.graph_objects as go
import plotly.express as px
import dash_core_components as dcc
import dash_html_components as html
from dash_table import DataTable, FormatTemplate
from utils import *
from datetime import date, timedelta
from math ... | 41.332231 | 81 | 0.477765 |
import dash
import plotly.graph_objects as go
import plotly.express as px
import dash_core_components as dcc
import dash_html_components as html
from dash_table import DataTable, FormatTemplate
from utils import *
from datetime import date, timedelta
from math import ceil
from backtest import *
from bloomb... | true | true |
79078b662dee357e0c099b4fd95ccd17c1e54069 | 7,215 | py | Python | wandb/vendor/pygments/lexers/smalltalk.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | wandb/vendor/pygments/lexers/smalltalk.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | wandb/vendor/pygments/lexers/smalltalk.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | # -*- coding: utf-8 -*-
"""
pygments.lexers.smalltalk
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Smalltalk and related languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups, defa... | 36.811224 | 88 | 0.427859 |
from pygments.lexer import RegexLexer, include, bygroups, default
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Number, Punctuation
__all__ = ['SmalltalkLexer', 'NewspeakLexer']
class SmalltalkLexer(RegexLexer):
name = 'Smalltalk'
filenames = ['*.st']
aliases = ['smal... | true | true |
79078d2d6cb76a38c500d4b3243655c644efa6ad | 1,036 | py | Python | fixture/application.py | oksanacps/python_for_testing | 6b358e1900518c02ea0732d95fff2cedb24272e1 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | oksanacps/python_for_testing | 6b358e1900518c02ea0732d95fff2cedb24272e1 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | oksanacps/python_for_testing | 6b358e1900518c02ea0732d95fff2cedb24272e1 | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox(capabilities={"marionette": Fa... | 30.470588 | 138 | 0.619691 | from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox(capabilities={"marionette": Fa... | true | true |
79078d3a91fd1b326df6198be67c254dfc19289c | 81 | py | Python | HacoWeb/haco/events/apps.py | DeanORourke1996/haco | fc04d763735ca376c51e82e1f1be20b092ce751c | [
"MIT"
] | null | null | null | HacoWeb/haco/events/apps.py | DeanORourke1996/haco | fc04d763735ca376c51e82e1f1be20b092ce751c | [
"MIT"
] | null | null | null | HacoWeb/haco/events/apps.py | DeanORourke1996/haco | fc04d763735ca376c51e82e1f1be20b092ce751c | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class Events(AppConfig):
name = 'events'
| 13.5 | 33 | 0.728395 | from django.apps import AppConfig
class Events(AppConfig):
name = 'events'
| true | true |
79078d42eeb06c659b02123ebd5b46621e1ddf48 | 3,909 | py | Python | Modules/Scripted/DMRIInstall/DMRIInstall.py | forfullstack/slicersources-src | 91bcecf037a27f3fad4c0ab57e8286fc258bb0f5 | [
"Apache-2.0"
] | null | null | null | Modules/Scripted/DMRIInstall/DMRIInstall.py | forfullstack/slicersources-src | 91bcecf037a27f3fad4c0ab57e8286fc258bb0f5 | [
"Apache-2.0"
] | null | null | null | Modules/Scripted/DMRIInstall/DMRIInstall.py | forfullstack/slicersources-src | 91bcecf037a27f3fad4c0ab57e8286fc258bb0f5 | [
"Apache-2.0"
] | null | null | null | import os
import string
import textwrap
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
#
# DMRIInstall
#
class DMRIInstall(ScriptedLoadableModule):
"""
"""
helpText = textwrap.dedent(
"""
The SlicerDMRI extension provides diffusion-related tools inclu... | 30.539063 | 97 | 0.712714 | import os
import string
import textwrap
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
class DMRIInstall(ScriptedLoadableModule):
helpText = textwrap.dedent(
"""
The SlicerDMRI extension provides diffusion-related tools including:
<ul>
<li> Diff... | true | true |
79078e60f336ac659b3e4be78384693a30f6d379 | 1,280 | py | Python | nodes/teleop_joy.py | Lovestarni/asv_simulator | 824c832f071c51212367569a07f67e2dadfc1401 | [
"MIT"
] | 7 | 2016-10-07T14:46:19.000Z | 2021-05-14T03:18:04.000Z | nodes/teleop_joy.py | Lovestarni/asv_simulator | 824c832f071c51212367569a07f67e2dadfc1401 | [
"MIT"
] | 2 | 2015-03-18T10:16:04.000Z | 2015-03-23T12:00:00.000Z | nodes/teleop_joy.py | Lovestarni/asv_simulator | 824c832f071c51212367569a07f67e2dadfc1401 | [
"MIT"
] | 1 | 2021-05-14T03:17:57.000Z | 2021-05-14T03:17:57.000Z | #!/usr/bin/env python
## @package teleop_joy A node for controlling the P3DX with an XBox controller
import rospy
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Joy
import numpy as np
def quat2yaw(q):
return np.arctan2(2*(q.y*q.z + q.w*q.x), 1 - 2*(q.z**2 + q.w... | 24.615385 | 78 | 0.715625 |
Odometry
from sensor_msgs.msg import Joy
import numpy as np
def quat2yaw(q):
return np.arctan2(2*(q.y*q.z + q.w*q.x), 1 - 2*(q.z**2 + q.w**2))
def joyCallback(msg):
global cmd_vel_pub
global linear_axis
global linear_scale
global rotation_axis
global rotation_scale
global yaw
cmd_v... | true | true |
79078f4776eebf20cf5d78387beeb983ccfe4a12 | 3,963 | py | Python | benchmark/startQiskit_noisy1996.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy1996.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy1996.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=32
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 33.871795 | 140 | 0.651527 |
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
im... | true | true |
79078f88f1002751c1f78d94c189c53568202ab0 | 1,743 | py | Python | 002_Particle_Filter/Particle_Filter.py | zhyongquan/Automotive-Software-Blog | c35bed037190fd6181f20c55d1621fd11f01480b | [
"MIT"
] | 4 | 2018-08-12T01:40:39.000Z | 2021-03-19T23:58:25.000Z | 002_Particle_Filter/Particle_Filter.py | zhyongquan/Automotive-Software-Blog | c35bed037190fd6181f20c55d1621fd11f01480b | [
"MIT"
] | null | null | null | 002_Particle_Filter/Particle_Filter.py | zhyongquan/Automotive-Software-Blog | c35bed037190fd6181f20c55d1621fd11f01480b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def estimate(particles, weights):
"""returns mean and variance of the weighted particles"""
pos = particles
mean = np.average(pos, weights=weights, axis=0)
var = np.average((pos - mean)**2, weights=weights, axis=0)
return mean, var
def s... | 29.05 | 93 | 0.650602 | import numpy as np
import matplotlib.pyplot as plt
def estimate(particles, weights):
pos = particles
mean = np.average(pos, weights=weights, axis=0)
var = np.average((pos - mean)**2, weights=weights, axis=0)
return mean, var
def simple_resample(particles, weights):
N = len(particles)
... | true | true |
7907903afbdf9bf8e217b08c3df28f2e7b310fd6 | 48 | py | Python | resources_crawler/__init__.py | ruzhnikov/resources-crawler | 700d316588d54ad142ce6ae48e5d1d62477e3e5e | [
"MIT"
] | null | null | null | resources_crawler/__init__.py | ruzhnikov/resources-crawler | 700d316588d54ad142ce6ae48e5d1d62477e3e5e | [
"MIT"
] | null | null | null | resources_crawler/__init__.py | ruzhnikov/resources-crawler | 700d316588d54ad142ce6ae48e5d1d62477e3e5e | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
__version__ = "0.1.0"
| 9.6 | 23 | 0.5 |
__version__ = "0.1.0"
| true | true |
790790f4f5ffb85003d5e29b48b026613b25aacf | 1,881 | py | Python | euca2ools/commands/iam/deleteaccount.py | salewski/euca2ools | 6b3f62f2cb1c54f14d3bfa5fd92dab3c0ecafecb | [
"BSD-2-Clause"
] | 30 | 2015-02-10T05:47:38.000Z | 2022-01-20T08:48:43.000Z | euca2ools/commands/iam/deleteaccount.py | salewski/euca2ools | 6b3f62f2cb1c54f14d3bfa5fd92dab3c0ecafecb | [
"BSD-2-Clause"
] | 16 | 2015-01-08T23:24:34.000Z | 2018-07-18T07:15:40.000Z | euca2ools/commands/iam/deleteaccount.py | salewski/euca2ools | 6b3f62f2cb1c54f14d3bfa5fd92dab3c0ecafecb | [
"BSD-2-Clause"
] | 19 | 2015-05-07T05:34:42.000Z | 2020-12-13T10:50:14.000Z | # Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | 49.5 | 78 | 0.743222 |
from requestbuilder import Arg
from euca2ools.commands.iam import IAMRequest, arg_account_name
class DeleteAccount(IAMRequest):
DESCRIPTION = '[Eucalyptus cloud admin only] Delete an account'
ARGS = [arg_account_name(
help='name or ID of the account to delete (require... | true | true |
790791c317e80f011fe64c0acfdb9d4842f95ca4 | 3,629 | py | Python | userbot/modules/gitcommit.py | fhmyngrh/ZELDA-UBOT | c75bb37f6cd952e429a869fb524c061c530b6046 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-12-27T02:23:24.000Z | 2021-12-28T06:25:39.000Z | userbot/modules/gitcommit.py | Ditomaheswara/Dito-Ubot | c75bb37f6cd952e429a869fb524c061c530b6046 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/gitcommit.py | Ditomaheswara/Dito-Ubot | c75bb37f6cd952e429a869fb524c061c530b6046 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2021-12-27T02:23:06.000Z | 2022-02-05T08:33:06.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
# Ported to UserBot by @Mayur_Karaniya
import os
import time
from datetime import datetime
from github import Github
#... | 35.23301 | 212 | 0.647837 |
import os
import time
from datetime import datetime
from github import Github
from userbot import CMD_HELP, GIT_REPO_NAME, GITHUB_ACCESS_TOKEN, bot
from userbot.events import zelda_cmd
GIT_TEMP_DIR = "./userbot/temp/"
@bot.on(zelda_cmd(outgoing=True, pattern=r"gcommit(?: |$)(.*)"))
async def download(even... | true | true |
790792a6a2d63a7e7be39c406e91d706802cb210 | 261 | gyp | Python | binding.gyp | kvantetore/function-info | d0a23cd8b641b8f724c15ddde44c78014150a4f5 | [
"MIT"
] | null | null | null | binding.gyp | kvantetore/function-info | d0a23cd8b641b8f724c15ddde44c78014150a4f5 | [
"MIT"
] | null | null | null | binding.gyp | kvantetore/function-info | d0a23cd8b641b8f724c15ddde44c78014150a4f5 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "functionInfo",
"sources": [
"src/functionInfo.cc"
],
"include_dirs": [
"<!(node -e \"require('nan')\")"
]
}
]
}
| 18.642857 | 48 | 0.310345 | {
"targets": [
{
"target_name": "functionInfo",
"sources": [
"src/functionInfo.cc"
],
"include_dirs": [
"<!(node -e \"require('nan')\")"
]
}
]
}
| true | true |
790792f77ef2f199b0c0e36b5d65248374cfbf35 | 11,771 | py | Python | nrekit/rl.py | qingdujun/manual-nre | c32ecc9397e2533dfd2cb8d7e5b9e748293028f8 | [
"MIT"
] | null | null | null | nrekit/rl.py | qingdujun/manual-nre | c32ecc9397e2533dfd2cb8d7e5b9e748293028f8 | [
"MIT"
] | null | null | null | nrekit/rl.py | qingdujun/manual-nre | c32ecc9397e2533dfd2cb8d7e5b9e748293028f8 | [
"MIT"
] | null | null | null | import tensorflow as tf
import os
import sklearn.metrics
import numpy as np
import sys
import math
import time
from . import framework
import network
class policy_agent(framework.re_model):
def __init__(self, train_data_loader, batch_size, max_length=120):
framework.re_model.__init__(self, train_data_loade... | 46.525692 | 231 | 0.572084 | import tensorflow as tf
import os
import sklearn.metrics
import numpy as np
import sys
import math
import time
from . import framework
import network
class policy_agent(framework.re_model):
def __init__(self, train_data_loader, batch_size, max_length=120):
framework.re_model.__init__(self, train_data_loade... | true | true |
79079306448d7aa431a61b49583653c5dd895108 | 2,289 | py | Python | src/attic/attic-python/test/test-secondorder.py | K0414/metaos | be36c88d3c22fd2f0968edd1fba03c2f2353e4e8 | [
"MIT"
] | 3 | 2017-04-10T16:23:32.000Z | 2020-07-04T07:59:25.000Z | src/attic/attic-python/test/test-secondorder.py | K0414/metaos | be36c88d3c22fd2f0968edd1fba03c2f2353e4e8 | [
"MIT"
] | null | null | null | src/attic/attic-python/test/test-secondorder.py | K0414/metaos | be36c88d3c22fd2f0968edd1fba03c2f2353e4e8 | [
"MIT"
] | 6 | 2017-10-25T10:12:27.000Z | 2020-07-04T07:59:27.000Z |
symbols = [ '1288.HK', '3988.HK', '0883.HK', '0939.HK', '2628.HK', '3968.HK', '0941.HK', '0688.HK', '0386.HK', '1088.HK', '0728.HK', '0762.HK', '1398.HK', '0857.HK', '2318.HK', '0700.HK', 'GAZPq.L', 'LKOHyq.L', 'NKELyq.L', 'NVTKq.L', 'RELIq.L', 'ROSNq.L', 'SNGSyq.L', 'TATNxq.L', 'BSBR.N', 'BBD.N', 'ABV.N', 'CIG.N', 'S... | 44.882353 | 430 | 0.596767 |
symbols = [ '1288.HK', '3988.HK', '0883.HK', '0939.HK', '2628.HK', '3968.HK', '0941.HK', '0688.HK', '0386.HK', '1088.HK', '0728.HK', '0762.HK', '1398.HK', '0857.HK', '2318.HK', '0700.HK', 'GAZPq.L', 'LKOHyq.L', 'NKELyq.L', 'NVTKq.L', 'RELIq.L', 'ROSNq.L', 'SNGSyq.L', 'TATNxq.L', 'BSBR.N', 'BBD.N', 'ABV.N', 'CIG.N', 'S... | false | true |
790793a63d8014c617fe74429ff161c2065931eb | 2,403 | py | Python | feature_importance_v4.py | terryli710/MPS_regression | d8f9c94ad315734ff9376a53e6be3f508b4da742 | [
"MIT"
] | null | null | null | feature_importance_v4.py | terryli710/MPS_regression | d8f9c94ad315734ff9376a53e6be3f508b4da742 | [
"MIT"
] | null | null | null | feature_importance_v4.py | terryli710/MPS_regression | d8f9c94ad315734ff9376a53e6be3f508b4da742 | [
"MIT"
] | null | null | null | ## Calculate feature importance, but focus on "meta-features" which are categorized by
## rules from different perspectives: orders, directions, powers.
## for "comprehensive methods"
from util_relaimpo import *
from util_ca import *
from util import loadNpy
def mainCA(x_name, y_name, divided_by = "", feature_names... | 37.546875 | 92 | 0.651685 | _name])
Y = loadNpy(['data', 'Y', y_name])
print("Dataset", x_name, y_name)
print("Method: ", "CA")
print("Divided by", divided_by)
if feature_names: xdf = pd.DataFrame(data=X, columns=feature_names)
else: xdf = pd.DataFrame(data=X)
x_list, feature_names = dvdX(xdf, divided_by... | true | true |
790793bc7b97f53cfb8310db981becae753e3b91 | 10,758 | py | Python | pydatview/tools/signal.py | cdrtm/pyDatView | fe1acacde27d4eafda0b54e455fadfb2d6199cd1 | [
"MIT"
] | null | null | null | pydatview/tools/signal.py | cdrtm/pyDatView | fe1acacde27d4eafda0b54e455fadfb2d6199cd1 | [
"MIT"
] | null | null | null | pydatview/tools/signal.py | cdrtm/pyDatView | fe1acacde27d4eafda0b54e455fadfb2d6199cd1 | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
from numpy.random import rand
import pandas as pd
# --- List of available filters
FILTERS=[
{'name':'Moving average','param':100,'paramName':'Window Size','paramRange':[0,100000],'increment':1},
{'name':'Low pass 1st order','param':1.0,'paramName':'Cutoff Fre... | 31.002882 | 119 | 0.533278 | from __future__ import division
import numpy as np
from numpy.random import rand
import pandas as pd
FILTERS=[
{'name':'Moving average','param':100,'paramName':'Window Size','paramRange':[0,100000],'increment':1},
{'name':'Low pass 1st order','param':1.0,'paramName':'Cutoff Freq.','paramRange':[0.0001,100000... | true | true |
790793fb6467579fd3b8eb4be805a081a2315aa9 | 65 | py | Python | Chapter 05/Chap05_Example5.33.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 05/Chap05_Example5.33.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 05/Chap05_Example5.33.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | #games module
import Kabaddi.raider
Kabaddi.raider.name_raider()
| 16.25 | 28 | 0.830769 |
import Kabaddi.raider
Kabaddi.raider.name_raider()
| true | true |
790794546c498205a96e392889ad6c516d954937 | 31,068 | py | Python | variation/methodological_experiment.py | tedunderwood/fiction | 33e2986fecaa3d154b5fdd609146b65d97974275 | [
"MIT"
] | 21 | 2016-05-25T00:02:19.000Z | 2021-11-23T06:51:07.000Z | variation/methodological_experiment.py | tedunderwood/fiction | 33e2986fecaa3d154b5fdd609146b65d97974275 | [
"MIT"
] | null | null | null | variation/methodological_experiment.py | tedunderwood/fiction | 33e2986fecaa3d154b5fdd609146b65d97974275 | [
"MIT"
] | 6 | 2016-10-18T12:56:18.000Z | 2020-09-01T01:36:02.000Z | #!/usr/bin/env python3
# methodological_experiment.py
import sys, os, csv
import numpy as np
import pandas as pd
import versatiletrainer2
import metaselector
import matplotlib.pyplot as plt
from scipy import stats
def first_experiment():
sourcefolder = '../data/'
metadatapath = '../metadata/mastermetadata... | 44.895954 | 360 | 0.629168 |
import sys, os, csv
import numpy as np
import pandas as pd
import versatiletrainer2
import metaselector
import matplotlib.pyplot as plt
from scipy import stats
def first_experiment():
sourcefolder = '../data/'
metadatapath = '../metadata/mastermetadata.csv'
vocabpath = '../modeloutput/experimentalvo... | true | true |
79079492aae6cd19fd5eaa852608c3016f5e6061 | 6,841 | py | Python | seleniumbase/plugins/db_reporting_plugin.py | Mu-L/SeleniumBase | 8387e89cfa3bd62a564246c0c00a94b8199b0792 | [
"MIT"
] | null | null | null | seleniumbase/plugins/db_reporting_plugin.py | Mu-L/SeleniumBase | 8387e89cfa3bd62a564246c0c00a94b8199b0792 | [
"MIT"
] | null | null | null | seleniumbase/plugins/db_reporting_plugin.py | Mu-L/SeleniumBase | 8387e89cfa3bd62a564246c0c00a94b8199b0792 | [
"MIT"
] | null | null | null | """
This plugin is for recording test results in the Testcase Database.
"""
import getpass
import time
import uuid
from nose.plugins import Plugin
from nose.exc import SkipTest
from seleniumbase.core.application_manager import ApplicationManager
from seleniumbase.core.testcase_manager import ExecutionQueryPayload
from... | 37.382514 | 79 | 0.612045 |
import getpass
import time
import uuid
from nose.plugins import Plugin
from nose.exc import SkipTest
from seleniumbase.core.application_manager import ApplicationManager
from seleniumbase.core.testcase_manager import ExecutionQueryPayload
from seleniumbase.core.testcase_manager import TestcaseDataPayload
from selenium... | true | true |
79079494201782699c4a87242adcde37ce225f93 | 1,577 | py | Python | slowfast/datasets/epickitchens_record.py | dylan-campbell/Motionformer | 6c860614a3b252c6163971ba20e61ea3184d5291 | [
"Apache-2.0"
] | 153 | 2021-06-10T14:00:22.000Z | 2022-03-31T04:12:54.000Z | slowfast/datasets/epickitchens_record.py | dylan-campbell/Motionformer | 6c860614a3b252c6163971ba20e61ea3184d5291 | [
"Apache-2.0"
] | 10 | 2021-06-30T04:48:50.000Z | 2022-03-11T15:51:05.000Z | slowfast/datasets/epickitchens_record.py | dylan-campbell/Motionformer | 6c860614a3b252c6163971ba20e61ea3184d5291 | [
"Apache-2.0"
] | 22 | 2021-06-11T13:10:05.000Z | 2022-03-28T03:42:39.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from .video_record import VideoRecord
from datetime import timedelta
import time
def timestamp_to_sec(timestamp):
x = time.strptime(timestamp, '%H:%M:%S.%f')
sec = float(timedelta(hours=x.tm_hour,
... | 28.672727 | 91 | 0.637286 |
from .video_record import VideoRecord
from datetime import timedelta
import time
def timestamp_to_sec(timestamp):
x = time.strptime(timestamp, '%H:%M:%S.%f')
sec = float(timedelta(hours=x.tm_hour,
minutes=x.tm_min,
seconds=x.tm_sec).total_seconds()) + flo... | true | true |
79079694c4688c982a416d7263117a1dc63c26a7 | 5,668 | py | Python | docs/tests/adhoc_requests.py | Siyanda-Mzam/grassroot-platform | 7130145e7ce46cece31e33cf85748d1777bcf566 | [
"BSD-3-Clause"
] | 1 | 2020-07-15T23:08:09.000Z | 2020-07-15T23:08:09.000Z | docs/tests/adhoc_requests.py | Siyanda-Mzam/grassroot-platform | 7130145e7ce46cece31e33cf85748d1777bcf566 | [
"BSD-3-Clause"
] | null | null | null | docs/tests/adhoc_requests.py | Siyanda-Mzam/grassroot-platform | 7130145e7ce46cece31e33cf85748d1777bcf566 | [
"BSD-3-Clause"
] | null | null | null | __author__ = 'aakilomar'
import requests, json, time
from timeit import default_timer as timer
requests.packages.urllib3.disable_warnings()
host = "https://localhost:8443"
def cancel_event(eventid):
post_url = host + "/api/event/cancel/" + str(eventid)
return requests.post(post_url,None, verify=False).json(... | 40.485714 | 159 | 0.702541 | __author__ = 'aakilomar'
import requests, json, time
from timeit import default_timer as timer
requests.packages.urllib3.disable_warnings()
host = "https://localhost:8443"
def cancel_event(eventid):
post_url = host + "/api/event/cancel/" + str(eventid)
return requests.post(post_url,None, verify=False).json(... | false | true |
7907975e3a6d3bcdb286b19767c81ff2bf531b32 | 549 | py | Python | Server/videoProcessServer/mysqlTools.py | kalenforn/video-context-analyze | a28c80b861664cfae73568845d753f3efc79c35a | [
"MIT"
] | 3 | 2021-05-08T10:28:41.000Z | 2021-06-23T14:33:07.000Z | Server/videoProcessServer/mysqlTools.py | kalenforn/video-context-analyze | a28c80b861664cfae73568845d753f3efc79c35a | [
"MIT"
] | null | null | null | Server/videoProcessServer/mysqlTools.py | kalenforn/video-context-analyze | a28c80b861664cfae73568845d753f3efc79c35a | [
"MIT"
] | 1 | 2021-05-08T10:28:43.000Z | 2021-05-08T10:28:43.000Z | import pymysql
class SQLHold():
def __init__(self, host: str, user: str, password: str, database: str, port=3306):
self.db = pymysql.connect(host=host, user=user, port=port, database=database, password=password)
self.cursor = self.db.cursor()
def execute_command(self, command: str):
s... | 27.45 | 104 | 0.642987 | import pymysql
class SQLHold():
def __init__(self, host: str, user: str, password: str, database: str, port=3306):
self.db = pymysql.connect(host=host, user=user, port=port, database=database, password=password)
self.cursor = self.db.cursor()
def execute_command(self, command: str):
s... | true | true |
7907979633bd22bf762087c7749c83e21c751284 | 6,641 | py | Python | Project_Plagiarism_Detection/source_pytorch/train.py | ngocpc/Project_Plagiarism_Detection | d06216d2aafa71e52c528f3ae451a49638e9785d | [
"MIT"
] | null | null | null | Project_Plagiarism_Detection/source_pytorch/train.py | ngocpc/Project_Plagiarism_Detection | d06216d2aafa71e52c528f3ae451a49638e9785d | [
"MIT"
] | null | null | null | Project_Plagiarism_Detection/source_pytorch/train.py | ngocpc/Project_Plagiarism_Detection | d06216d2aafa71e52c528f3ae451a49638e9785d | [
"MIT"
] | null | null | null | import argparse
import json
import os
import pandas as pd
import torch
import torch.optim as optim
import torch.nn as nn
import torch.utils.data
# imports the model in model.py by name
from model import BinaryClassifier
def model_fn(model_dir):
"""Load the PyTorch model from the `model_dir` directory."""
prin... | 38.166667 | 110 | 0.657732 | import argparse
import json
import os
import pandas as pd
import torch
import torch.optim as optim
import torch.nn as nn
import torch.utils.data
from model import BinaryClassifier
def model_fn(model_dir):
print("Loading model.")
model_info = {}
model_info_path = os.path.join(model_dir, 'model_info.... | true | true |
790797cc5d1cdf58ae01700d892b4288c141b86b | 6,728 | py | Python | userbot/modules/profile.py | BintangAlGhifari/WeebProject | 52e269a50852c26e42159817661cb9573c2f126d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-03-31T18:38:45.000Z | 2021-03-31T18:38:45.000Z | userbot/modules/profile.py | BintangAlGhifari/WeebProject | 52e269a50852c26e42159817661cb9573c2f126d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/profile.py | BintangAlGhifari/WeebProject | 52e269a50852c26e42159817661cb9573c2f126d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-02-20T15:12:24.000Z | 2022-02-20T15:12:24.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for changing your Telegram profile details. """
import os
from telethon.errors import ImageProcess... | 34.860104 | 101 | 0.636147 |
import os
from telethon.errors import ImageProcessFailedError, PhotoCropSizeSmallError
from telethon.errors.rpcerrorlist import PhotoExtInvalidError, UsernameOccupiedError
from telethon.tl.functions.account import UpdateProfileRequest, UpdateUsernameRequest
from telethon.tl.functions.channels import GetAdminedPu... | true | true |
790798a8add54f92b26413127250214a1881274b | 697 | py | Python | DDPG/test_ddpg_puckWorld.py | WoShiDongZhiWu/Reinforcement-learning-Algorithm | 59fdf29e7feb73048b9ddf3b4755b55f0459efcb | [
"Apache-2.0"
] | 1 | 2019-12-23T02:59:13.000Z | 2019-12-23T02:59:13.000Z | DDPG/test_ddpg_puckWorld.py | WoShiDongZhiWu/reinforcement-learning-algorithm | 59fdf29e7feb73048b9ddf3b4755b55f0459efcb | [
"Apache-2.0"
] | null | null | null | DDPG/test_ddpg_puckWorld.py | WoShiDongZhiWu/reinforcement-learning-algorithm | 59fdf29e7feb73048b9ddf3b4755b55f0459efcb | [
"Apache-2.0"
] | null | null | null | '''
####################################################################
# author wudong
# date 20190816
# 在连续的puckworld空间中测试DDPG
# 状态空间和行为空间连续
# 状态空间:x,y
# 行为空间:水平和竖直方向上的力的大小[-1,1]
# ps 不知道是计算机的原因还是算法的原因,训练不动
######################################################################
'''
import gym
from puckworld_continuo... | 24.892857 | 73 | 0.625538 |
import gym
from puckworld_continuous import PuckWorldEnv
from ddpg_agent import DDPGAgent
from utils import learning_curve
import numpy as np
env = PuckWorldEnv()
agent = DDPGAgent(env)
data = agent.learning(max_episode_num=200,display=True,explore=True)
| true | true |
790798b566f115e99c28b9b7abde16a2d2fc73e5 | 1,325 | py | Python | quarantineworkout/workout/schema.py | adeoke/django-quarantine-workout-graphql | 7d53bb17f8ee9e5276b496d00ff92c4b458af31f | [
"MIT"
] | 1 | 2020-06-01T11:41:52.000Z | 2020-06-01T11:41:52.000Z | quarantineworkout/workout/schema.py | adeoke/django-quarantine-workout-graphql | 7d53bb17f8ee9e5276b496d00ff92c4b458af31f | [
"MIT"
] | 5 | 2020-06-06T15:14:21.000Z | 2021-06-10T19:25:55.000Z | quarantineworkout/workout/schema.py | adeoke/django-quarantine-workout-graphql | 7d53bb17f8ee9e5276b496d00ff92c4b458af31f | [
"MIT"
] | 1 | 2022-01-19T22:17:44.000Z | 2022-01-19T22:17:44.000Z | """Workout schema module"""
import graphene
from exercises.schema import ExerciseType
from exercises.models import Exercise
class Query(graphene.ObjectType):
"""Workout query class"""
workout = graphene.List(ExerciseType,
body_part=graphene.String(),
exe... | 36.805556 | 77 | 0.612075 | import graphene
from exercises.schema import ExerciseType
from exercises.models import Exercise
class Query(graphene.ObjectType):
workout = graphene.List(ExerciseType,
body_part=graphene.String(),
exercise_name=graphene.String(),
... | true | true |
790798beeadcf685cc4291097796e2d302a38fec | 239 | py | Python | revise/libs/python/pyste/src/Pyste/__init__.py | DD-L/deel.boost.python | e32cd62022bbf7c5822d150150330d988e041f02 | [
"MIT"
] | 198 | 2015-01-13T05:47:18.000Z | 2022-03-09T04:46:46.000Z | thirdparty/boost-python/libs/python/pyste/src/Pyste/__init__.py | alexa-infra/negine | d9060a7c83a41c95c361c470b56c2ddab3ba04de | [
"MIT"
] | 9 | 2015-01-28T16:33:19.000Z | 2020-04-12T23:03:28.000Z | thirdparty/boost-python/libs/python/pyste/src/Pyste/__init__.py | alexa-infra/negine | d9060a7c83a41c95c361c470b56c2ddab3ba04de | [
"MIT"
] | 139 | 2015-01-15T20:09:31.000Z | 2022-01-31T15:21:16.000Z | # Copyright Bruno da Silva de Oliveira 2003. Use, modification and
# distribution is subject to the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
| 34.142857 | 70 | 0.74477 | true | true | |
790799489399fbdd8e34504a305e5faaddb7732c | 339 | py | Python | illumio/vulnerabilities/vulnerability.py | dsommerville-illumio/illumio-py | 30e9ee4237b142a62579839ed8a21f2eb35c8b09 | [
"Apache-2.0"
] | 1 | 2022-01-18T04:55:16.000Z | 2022-01-18T04:55:16.000Z | illumio/vulnerabilities/vulnerability.py | dsommerville-illumio/illumio-py | 30e9ee4237b142a62579839ed8a21f2eb35c8b09 | [
"Apache-2.0"
] | null | null | null | illumio/vulnerabilities/vulnerability.py | dsommerville-illumio/illumio-py | 30e9ee4237b142a62579839ed8a21f2eb35c8b09 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""This module is a stub for classes related to vulnerability exposure scores.
Copyright:
(c) 2022 Illumio
License:
Apache2, see LICENSE for more details.
"""
from dataclasses import dataclass
from illumio.util import MutableObject
@dataclass
class Vulnerability(MutableObject):
... | 17.842105 | 78 | 0.731563 |
from dataclasses import dataclass
from illumio.util import MutableObject
@dataclass
class Vulnerability(MutableObject):
score: int = None
| true | true |
79079993122d1758e73e04158a76617e6210ab69 | 5,798 | py | Python | diffxpy/unit_test/test_pairwise.py | grst/diffxpy | 8b9ad605cb11d05b58b3e3f4b2c8255c6e98b80c | [
"BSD-3-Clause"
] | null | null | null | diffxpy/unit_test/test_pairwise.py | grst/diffxpy | 8b9ad605cb11d05b58b3e3f4b2c8255c6e98b80c | [
"BSD-3-Clause"
] | null | null | null | diffxpy/unit_test/test_pairwise.py | grst/diffxpy | 8b9ad605cb11d05b58b3e3f4b2c8255c6e98b80c | [
"BSD-3-Clause"
] | null | null | null | import logging
import unittest
import numpy as np
import pandas as pd
import scipy.stats as stats
import diffxpy.api as de
class _TestPairwiseNull:
noise_model: str
def _prepate_data(
self,
n_cells: int,
n_genes: int,
n_groups: int
):
if self.nois... | 37.649351 | 104 | 0.657641 | import logging
import unittest
import numpy as np
import pandas as pd
import scipy.stats as stats
import diffxpy.api as de
class _TestPairwiseNull:
noise_model: str
def _prepate_data(
self,
n_cells: int,
n_genes: int,
n_groups: int
):
if self.nois... | true | true |
79079a504f225a6dad9dbbe420213c27590aff1c | 5,654 | py | Python | src/pm/mpd/test/test1.py | raffenet/mpich-CVS | 2d33e2742e8c00db4f56a373fea051cc6c0ee0d0 | [
"mpich2"
] | 1 | 2021-11-11T15:42:30.000Z | 2021-11-11T15:42:30.000Z | src/pm/mpd/test/test1.py | grondo/mvapich2-cce | ec084d8e07db1cf2ac1352ee4c604ae7dbae55cb | [
"Intel",
"mpich2",
"Unlicense"
] | null | null | null | src/pm/mpd/test/test1.py | grondo/mvapich2-cce | ec084d8e07db1cf2ac1352ee4c604ae7dbae55cb | [
"Intel",
"mpich2",
"Unlicense"
] | null | null | null | #!/usr/bin/env python
#
# (C) 2001 by Argonne National Laboratory.
# See COPYRIGHT in top-level directory.
#
# Note that I repeat code for each test just in case I want to
# run one separately. I can simply copy it out of here and run it.
# A single test can typically be chgd simply by altering its value(s)
#... | 35.559748 | 91 | 0.666785 |
import os, sys, commands, time
sys.path += [os.getcwd()]
print "mpd tests---------------------------------------------------"
clusterHosts = [ 'bp4%02d' % (i) for i in range(0,8) ]
print "clusterHosts=", clusterHosts
print "TEST -e -d"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdl... | false | true |
79079a52fc6caccb1e1a414f7a5e105c8b09afe0 | 5,248 | py | Python | planner/regressor/models.py | aljubrmj/CS342-Final-Project | 841bab59ca1311faa550c5fce9327a1e65ff5501 | [
"MIT"
] | null | null | null | planner/regressor/models.py | aljubrmj/CS342-Final-Project | 841bab59ca1311faa550c5fce9327a1e65ff5501 | [
"MIT"
] | null | null | null | planner/regressor/models.py | aljubrmj/CS342-Final-Project | 841bab59ca1311faa550c5fce9327a1e65ff5501 | [
"MIT"
] | null | null | null | import torch
import torch.nn.functional as F
def spatial_argmax(logit):
weights = F.softmax(logit.view(logit.size(0), -1), dim=-1).view_as(logit)
return torch.stack(((weights.sum(1) * torch.linspace(-1, 1, logit.size(2)).to(logit.device)[None]).sum(1),
(weights.sum(2) * torch.linspace(-... | 38.874074 | 120 | 0.59013 | import torch
import torch.nn.functional as F
def spatial_argmax(logit):
weights = F.softmax(logit.view(logit.size(0), -1), dim=-1).view_as(logit)
return torch.stack(((weights.sum(1) * torch.linspace(-1, 1, logit.size(2)).to(logit.device)[None]).sum(1),
(weights.sum(2) * torch.linspace(-... | true | true |
79079a67b0693a62f82930e2f2ea574ff8a1de19 | 2,769 | py | Python | satchmo/apps/satchmo_store/shop/templatetags/satchmo_adminapplist.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | 16 | 2015-03-06T14:42:27.000Z | 2019-12-23T21:37:01.000Z | satchmo/apps/satchmo_store/shop/templatetags/satchmo_adminapplist.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | null | null | null | satchmo/apps/satchmo_store/shop/templatetags/satchmo_adminapplist.py | funwhilelost/satchmo | 589a5d797533ea15dfde9af7f36e304092d22a94 | [
"BSD-3-Clause"
] | 8 | 2015-01-28T16:02:37.000Z | 2022-03-03T21:29:40.000Z | from django import template
from django.db import models
register = template.Library()
try:
''.rsplit
def rsplit(s, delim, maxsplit):
return s.rsplit(delim, maxsplit)
except AttributeError:
def rsplit(s, delim, maxsplit):
"""
Return a list of the words of the string s, scanning s
... | 37.931507 | 107 | 0.611051 | from django import template
from django.db import models
register = template.Library()
try:
''.rsplit
def rsplit(s, delim, maxsplit):
return s.rsplit(delim, maxsplit)
except AttributeError:
def rsplit(s, delim, maxsplit):
"""
Return a list of the words of the string s, scanning s
... | false | true |
79079ab7abcc6b005780047d1580727377856806 | 25 | py | Python | vyxal/__init__.py | kokonut27/Vyxal | 2277d18f69dc5a4c04b2f0bd4d55c90cdf2faa48 | [
"MIT"
] | null | null | null | vyxal/__init__.py | kokonut27/Vyxal | 2277d18f69dc5a4c04b2f0bd4d55c90cdf2faa48 | [
"MIT"
] | null | null | null | vyxal/__init__.py | kokonut27/Vyxal | 2277d18f69dc5a4c04b2f0bd4d55c90cdf2faa48 | [
"MIT"
] | null | null | null | from .__main__ import *
| 12.5 | 24 | 0.72 | from .__main__ import *
| true | true |
79079afb5049c4952a78491f534997124403c2b1 | 999 | py | Python | sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_communication_network_traversal_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 may ... | 43.434783 | 99 | 0.648649 |
from enum import Enum
from six import with_metaclass
from azure.core import CaseInsensitiveEnumMeta
class RouteType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
ANY = "any"
NEAREST = "nearest"
| true | true |
79079c5b218ef998585d306cd73632cfaf662f01 | 5,011 | py | Python | src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py | zackliu/azure-cli | 680f8339ac010a89d4063566fabc5991abc8a4c2 | [
"MIT"
] | 7 | 2020-04-26T09:54:05.000Z | 2021-07-22T16:54:41.000Z | src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py | zackliu/azure-cli | 680f8339ac010a89d4063566fabc5991abc8a4c2 | [
"MIT"
] | 2 | 2017-02-11T21:16:40.000Z | 2017-02-11T21:30:54.000Z | src/azure-cli/azure/cli/command_modules/databoxedge/manual/custom.py | zackliu/azure-cli | 680f8339ac010a89d4063566fabc5991abc8a4c2 | [
"MIT"
] | 13 | 2020-06-30T16:23:36.000Z | 2022-03-29T17:12:05.000Z | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 42.109244 | 85 | 0.50908 |
from azure.cli.core.util import sdk_no_wait
def databoxedge_device_create(client,
device_name,
resource_group_name,
location,
tags=None,
sku=None,
... | true | true |
79079db03e54484a4981e88387ee2577eda2bd20 | 1,039 | py | Python | tests/cmdexpr/ruler.py | RLToolsWorkshop/tunnel-arrow | f4e8575ed3a7a796cc6c3178165ebb2dd63f35aa | [
"Apache-2.0"
] | null | null | null | tests/cmdexpr/ruler.py | RLToolsWorkshop/tunnel-arrow | f4e8575ed3a7a796cc6c3178165ebb2dd63f35aa | [
"Apache-2.0"
] | null | null | null | tests/cmdexpr/ruler.py | RLToolsWorkshop/tunnel-arrow | f4e8575ed3a7a796cc6c3178165ebb2dd63f35aa | [
"Apache-2.0"
] | 2 | 2021-07-10T11:35:45.000Z | 2021-07-14T21:34:10.000Z | from lark import Lark, Transformer, v_args
from lark.visitors import Interpreter, visit_children_decor
p = Lark.open("rules.lark", parser="lalr", rel_to=__file__)
code = """
// Firrst win in my book
b = 4;
a = b*2;
print a+1
x = 7;
p = [1, 2, 3, 4]
print p
"""
tree = p.parse(code)
@v_args(inline=True)
class MyEval... | 18.553571 | 61 | 0.638114 | from lark import Lark, Transformer, v_args
from lark.visitors import Interpreter, visit_children_decor
p = Lark.open("rules.lark", parser="lalr", rel_to=__file__)
code = """
// Firrst win in my book
b = 4;
a = b*2;
print a+1
x = 7;
p = [1, 2, 3, 4]
print p
"""
tree = p.parse(code)
@v_args(inline=True)
class MyEval... | true | true |
79079e03168c0cf116ebbaac01d749cb566d0117 | 1,458 | py | Python | xhtml2pdf/turbogears.py | trib3/xhtml2pdf | 5211b7926ae3183176091f48fbd2e76e29c47095 | [
"Apache-2.0"
] | null | null | null | xhtml2pdf/turbogears.py | trib3/xhtml2pdf | 5211b7926ae3183176091f48fbd2e76e29c47095 | [
"Apache-2.0"
] | null | null | null | xhtml2pdf/turbogears.py | trib3/xhtml2pdf | 5211b7926ae3183176091f48fbd2e76e29c47095 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | 32.4 | 105 | 0.663237 |
from turbogears.decorator import weak_signature_decorator
import xhtml2pdf.pisa as pisa
from six import StringIO
import cherrypy
def to_pdf(filename=None, content_type="application/pdf"):
def entangle(func):
def decorated(func, *args, **kw):
output = func(*args, **kw)
... | true | true |
79079e21ec728c3fde4a64fc02ca958ea7756300 | 4,188 | py | Python | custom_scripts/hooks.py | VPS-Consultancy/custom_scripts | c812c8fa670c6e3c0e8d94d5ce22638b0daeb522 | [
"MIT"
] | null | null | null | custom_scripts/hooks.py | VPS-Consultancy/custom_scripts | c812c8fa670c6e3c0e8d94d5ce22638b0daeb522 | [
"MIT"
] | null | null | null | custom_scripts/hooks.py | VPS-Consultancy/custom_scripts | c812c8fa670c6e3c0e8d94d5ce22638b0daeb522 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "custom_scripts"
app_title = "Custom Scripts"
app_publisher = "C.R.I.O"
app_description = "For custom scripts"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "criogroups@gmail... | 24.635294 | 107 | 0.685769 |
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "custom_scripts"
app_title = "Custom Scripts"
app_publisher = "C.R.I.O"
app_description = "For custom scripts"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "criogroups@gmail.com"
app_license = "MI... | true | true |
79079e5e0ff5a602fbb8710f9e816f9785399d47 | 2,108 | py | Python | txcl/utils/deploy_helpers.py | digitalepidemiologylab/text-classification | 8a92a9f6d67857de7de5dcb72a41f75061572e9a | [
"MIT"
] | 3 | 2020-06-08T13:49:27.000Z | 2020-12-01T12:07:29.000Z | txcl/utils/deploy_helpers.py | crowdbreaks/text-classification | 8a92a9f6d67857de7de5dcb72a41f75061572e9a | [
"MIT"
] | 8 | 2020-06-17T14:21:20.000Z | 2020-11-03T11:43:57.000Z | txcl/utils/deploy_helpers.py | crowdbreaks/text-classification | 8a92a9f6d67857de7de5dcb72a41f75061572e9a | [
"MIT"
] | null | null | null | """
Deployment helpers
==================
"""
import os
import logging
from ..definitions import ROOT_DIR
from .docker import Docker
from .ecr import ECR
from .s3 import S3
from .sagemaker import Sagemaker
logger = logging.getLogger(__name__)
def build(run, project, model_type):
docker = Docker()
docker_pat... | 31.462687 | 108 | 0.70778 |
import os
import logging
from ..definitions import ROOT_DIR
from .docker import Docker
from .ecr import ECR
from .s3 import S3
from .sagemaker import Sagemaker
logger = logging.getLogger(__name__)
def build(run, project, model_type):
docker = Docker()
docker_path = os.path.join(ROOT_DIR, 'sagemaker', model_... | true | true |
7907a05b1b790d8810def314c40b88b5f6527f37 | 11,713 | py | Python | tests/test_xmlparser.py | Fake4d/mosk | d15c6088a382a51706bd38e3299d00be5c208acc | [
"CC0-1.0"
] | 3 | 2021-05-22T11:14:10.000Z | 2022-02-18T00:32:10.000Z | tests/test_xmlparser.py | Fake4d/mosk | d15c6088a382a51706bd38e3299d00be5c208acc | [
"CC0-1.0"
] | 1 | 2021-06-20T07:18:58.000Z | 2021-09-19T12:24:03.000Z | tests/test_xmlparser.py | Fake4d/mosk | d15c6088a382a51706bd38e3299d00be5c208acc | [
"CC0-1.0"
] | 1 | 2021-06-09T07:43:03.000Z | 2021-06-09T07:43:03.000Z | from unittest import TestCase
from unittest.mock import patch
from xmlschema import XMLSchemaException
from xml.dom.minidom import Element, Document, parse
class TestXmlParserInstructionspath(TestCase):
@patch('businesslogic.placeholders.Placeholder._initialize_global_placeholders')
@patch('instructionparsers... | 45.753906 | 115 | 0.712029 | from unittest import TestCase
from unittest.mock import patch
from xmlschema import XMLSchemaException
from xml.dom.minidom import Element, Document, parse
class TestXmlParserInstructionspath(TestCase):
@patch('businesslogic.placeholders.Placeholder._initialize_global_placeholders')
@patch('instructionparsers... | true | true |
7907a0c6881573c03f84b97b6b5307726128a7fe | 3,344 | py | Python | plaso/parsers/plist_plugins/launchd.py | ddm1004/plaso | 88d44561754c5f981d4ab96d53186d1fc5f97f98 | [
"Apache-2.0"
] | 1 | 2020-10-29T18:23:25.000Z | 2020-10-29T18:23:25.000Z | plaso/parsers/plist_plugins/launchd.py | joshlemon/plaso | 9f8e05f21fa23793bfdade6af1d617e9dd092531 | [
"Apache-2.0"
] | null | null | null | plaso/parsers/plist_plugins/launchd.py | joshlemon/plaso | 9f8e05f21fa23793bfdade6af1d617e9dd092531 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Launchd plist plugin."""
from __future__ import unicode_literals
from dfdatetime import semantic_time as dfdatetime_semantic_time
from plaso.containers import plist_event
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import plist
from plaso.p... | 33.777778 | 78 | 0.704246 |
from __future__ import unicode_literals
from dfdatetime import semantic_time as dfdatetime_semantic_time
from plaso.containers import plist_event
from plaso.containers import time_events
from plaso.lib import definitions
from plaso.parsers import plist
from plaso.parsers.plist_plugins import interface
class Launc... | true | true |
7907a1ebe04301894670a171194a25925fbfc017 | 2,105 | py | Python | src/cosmic_ray/tools/filters/operators_filter.py | XD-DENG/cosmic-ray | d265dd0c7bf65484ee2ff1503129b2b16d0c7f55 | [
"MIT"
] | 1 | 2020-10-18T11:29:03.000Z | 2020-10-18T11:29:03.000Z | src/cosmic_ray/tools/filters/operators_filter.py | XD-DENG/cosmic-ray | d265dd0c7bf65484ee2ff1503129b2b16d0c7f55 | [
"MIT"
] | 4 | 2020-11-21T07:36:24.000Z | 2020-11-22T03:09:39.000Z | src/cosmic_ray/tools/filters/operators_filter.py | XD-DENG/cosmic-ray | d265dd0c7bf65484ee2ff1503129b2b16d0c7f55 | [
"MIT"
] | null | null | null | """An filter that removes operators based on regular expressions.
"""
from argparse import Namespace
import logging
import re
import sys
from cosmic_ray.config import load_config
from cosmic_ray.work_db import WorkDB
from cosmic_ray.work_item import WorkerOutcome, WorkResult
from cosmic_ray.tools.filters.filter_app im... | 29.647887 | 98 | 0.59905 | from argparse import Namespace
import logging
import re
import sys
from cosmic_ray.config import load_config
from cosmic_ray.work_db import WorkDB
from cosmic_ray.work_item import WorkerOutcome, WorkResult
from cosmic_ray.tools.filters.filter_app import FilterApp
log = logging.getLogger()
class OperatorsFilter(Filt... | true | true |
7907a2b8b434229113f51c903ecf29a8bffd7315 | 1,708 | py | Python | app/Http/Controllers/Dashboard/Wan_edge_Health.py | victornguyen98/luanvan2020 | b1f9d8fbed1cae5054678217ca069e5c22a05e95 | [
"MIT"
] | null | null | null | app/Http/Controllers/Dashboard/Wan_edge_Health.py | victornguyen98/luanvan2020 | b1f9d8fbed1cae5054678217ca069e5c22a05e95 | [
"MIT"
] | null | null | null | app/Http/Controllers/Dashboard/Wan_edge_Health.py | victornguyen98/luanvan2020 | b1f9d8fbed1cae5054678217ca069e5c22a05e95 | [
"MIT"
] | null | null | null | import requests
import sys
import json
requests.packages.urllib3.disable_warnings()
from requests.packages.urllib3.exceptions import InsecureRequestWarning
SDWAN_IP = "10.10.20.90"
SDWAN_USERNAME = "admin"
SDWAN_PASSWORD = "C1sco12345"
class rest_api_lib:
def __init__(self, vmanage_ip, username, password):
... | 32.226415 | 165 | 0.652225 | import requests
import sys
import json
requests.packages.urllib3.disable_warnings()
from requests.packages.urllib3.exceptions import InsecureRequestWarning
SDWAN_IP = "10.10.20.90"
SDWAN_USERNAME = "admin"
SDWAN_PASSWORD = "C1sco12345"
class rest_api_lib:
def __init__(self, vmanage_ip, username, password):
... | true | true |
7907a3fc0d32d5dd0880905e2a5f1691a3a1ca66 | 159 | py | Python | active_learning/heuristics/__init__.py | bpanahij/maskal | 5a565854d43c80cac8a4c5d9996a1042db70633e | [
"Apache-2.0"
] | 11 | 2021-12-17T09:12:57.000Z | 2022-03-23T18:27:17.000Z | active_learning/heuristics/__init__.py | bpanahij/maskal | 5a565854d43c80cac8a4c5d9996a1042db70633e | [
"Apache-2.0"
] | null | null | null | active_learning/heuristics/__init__.py | bpanahij/maskal | 5a565854d43c80cac8a4c5d9996a1042db70633e | [
"Apache-2.0"
] | 1 | 2022-01-26T23:25:08.000Z | 2022-01-26T23:25:08.000Z | # @Author: Pieter Blok
# @Date: 2021-03-25 15:33:17
# @Last Modified by: Pieter Blok
# @Last Modified time: 2021-03-25 15:36:30
from .uncertainty import * | 26.5 | 42 | 0.685535 |
from .uncertainty import * | true | true |
7907a4ff5091c058e80a00f676d1dfa90abdc138 | 603 | py | Python | equinox/models/terrain.py | ProfAndreaPollini/opengl-pyglet-python-game-programming | 97b07f8f0e9f58da5bde5244a6a2f809fe4bfee4 | [
"MIT"
] | null | null | null | equinox/models/terrain.py | ProfAndreaPollini/opengl-pyglet-python-game-programming | 97b07f8f0e9f58da5bde5244a6a2f809fe4bfee4 | [
"MIT"
] | 2 | 2019-09-05T16:08:42.000Z | 2019-09-05T16:09:50.000Z | equinox/models/terrain.py | ProfAndreaPollini/opengl-pyglet-python-game-programming | 97b07f8f0e9f58da5bde5244a6a2f809fe4bfee4 | [
"MIT"
] | null | null | null |
from equinox.models import Model,cleanup
import glm
from random import random
from .glutils import bindIndicesToBuffer, storeDataInVBO,createVAO,unbindVAO
class Terrain(Model):
def __init__(self, n_vertex):
self.vertices = (
-1.0, 0.0, 1.0,
-1.0, 0.0, -1.0,
1.... | 17.735294 | 76 | 0.434494 |
from equinox.models import Model,cleanup
import glm
from random import random
from .glutils import bindIndicesToBuffer, storeDataInVBO,createVAO,unbindVAO
class Terrain(Model):
def __init__(self, n_vertex):
self.vertices = (
-1.0, 0.0, 1.0,
-1.0, 0.0, -1.0,
1.... | true | true |
7907a5c807f771b07d497406a9527bb2680943a7 | 1,091 | py | Python | challenges/2019/python/d02.py | basoares/advent-of-code | 3b8216f0e73b12fd879aecea56783b8db7a4bc16 | [
"MIT"
] | null | null | null | challenges/2019/python/d02.py | basoares/advent-of-code | 3b8216f0e73b12fd879aecea56783b8db7a4bc16 | [
"MIT"
] | null | null | null | challenges/2019/python/d02.py | basoares/advent-of-code | 3b8216f0e73b12fd879aecea56783b8db7a4bc16 | [
"MIT"
] | null | null | null | '''
Advent of Code - 2019
--- Day 2: 1202 Program Alarm ---
'''
from utils import *
from intcode import IntcodeRunner, HaltExecution
def parse_input(day):
return day_input(day, integers)[0]
def part1(program, noun=12, verb=2):
runner = IntcodeRunner(program)
runner.set_mem(1, noun)
runner.set_... | 21.82 | 48 | 0.549954 |
from utils import *
from intcode import IntcodeRunner, HaltExecution
def parse_input(day):
return day_input(day, integers)[0]
def part1(program, noun=12, verb=2):
runner = IntcodeRunner(program)
runner.set_mem(1, noun)
runner.set_mem(2, verb)
while True:
try:
next(runner.run... | true | true |
7907a62d9c5f4e3cc08661841f9c3579ca113575 | 1,094 | py | Python | classes/utility.py | pianomanx/Scavenger | 75907e802e4e2b019b1927fb5ab950a10f7d5798 | [
"MIT"
] | 465 | 2018-06-24T16:21:44.000Z | 2022-03-24T11:59:06.000Z | classes/utility.py | SCR-Hy3n4/Scavenger | 75907e802e4e2b019b1927fb5ab950a10f7d5798 | [
"Apache-2.0"
] | 6 | 2018-12-27T15:51:46.000Z | 2021-04-15T07:32:36.000Z | classes/utility.py | watchmen-coder/Scavenger | 75907e802e4e2b019b1927fb5ab950a10f7d5798 | [
"MIT"
] | 101 | 2018-10-28T10:55:05.000Z | 2022-03-31T15:29:15.000Z | #!/usr/bin/python
import time
import re
import os
class ScavUtility:
def __init__(self):
pass
def check(self, email):
regex = '^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@[^-][A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$'
if (re.search(regex, email)):
return 1
... | 29.567568 | 120 | 0.54479 |
import time
import re
import os
class ScavUtility:
def __init__(self):
pass
def check(self, email):
regex = '^(?=.{1,64}@)[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*@[^-][A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,})$'
if (re.search(regex, email)):
return 1
else:
... | true | true |
7907a67411c9823c139a7c3923c2fa5934f7410d | 2,763 | py | Python | facade_project/utils/ml_utils.py | gregunz/MasterSemesterProject | 085f36c58b1cac141b0318657876b796c4dc5101 | [
"MIT"
] | 5 | 2019-06-10T08:42:00.000Z | 2021-09-22T08:24:24.000Z | facade_project/utils/ml_utils.py | gregunz/MasterSemesterProject | 085f36c58b1cac141b0318657876b796c4dc5101 | [
"MIT"
] | 1 | 2019-10-31T12:56:27.000Z | 2019-10-31T12:56:27.000Z | facade_project/utils/ml_utils.py | gregunz/MasterSemesterProject | 085f36c58b1cac141b0318657876b796c4dc5101 | [
"MIT"
] | 2 | 2019-09-13T10:23:34.000Z | 2021-05-07T14:15:46.000Z | class MetricHandler:
"""
Object meant to be used in the training loop to handle metrics logs
"""
def __init__(self):
pass
def add(self, outputs, targets):
"""
Adding metric for each batch
:param outputs: outputs of the model
:param targets: targets of the m... | 27.356436 | 99 | 0.565328 | class MetricHandler:
def __init__(self):
pass
def add(self, outputs, targets):
raise NotImplementedError()
def compute(self, phase):
raise NotImplementedError()
def description(self, phase):
raise NotImplementedError()
def scalar_infos(self, phase):
raise... | true | true |
7907a6dab3d5350f45255dc59d81a6c782e2052e | 917 | py | Python | tableauserverclient/server/endpoint/exceptions.py | reevery/server-client-python | c4ed22ebf62e74707961a77381848ad325d55850 | [
"MIT"
] | null | null | null | tableauserverclient/server/endpoint/exceptions.py | reevery/server-client-python | c4ed22ebf62e74707961a77381848ad325d55850 | [
"MIT"
] | null | null | null | tableauserverclient/server/endpoint/exceptions.py | reevery/server-client-python | c4ed22ebf62e74707961a77381848ad325d55850 | [
"MIT"
] | 1 | 2020-04-17T15:41:39.000Z | 2020-04-17T15:41:39.000Z | import xml.etree.ElementTree as ET
from .. import NAMESPACE
class ServerResponseError(Exception):
def __init__(self, code, summary, detail):
self.code = code
self.summary = summary
self.detail = detail
super(ServerResponseError, self).__init__(str(self))
def __str__(self):
... | 33.962963 | 99 | 0.642312 | import xml.etree.ElementTree as ET
from .. import NAMESPACE
class ServerResponseError(Exception):
def __init__(self, code, summary, detail):
self.code = code
self.summary = summary
self.detail = detail
super(ServerResponseError, self).__init__(str(self))
def __str__(self):
... | true | true |
7907a715924fca616c9859e5e80e85ffdcbf6627 | 2,724 | py | Python | tests/gis_tests/geoapp/test_sitemaps.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 16 | 2019-08-10T12:24:06.000Z | 2020-05-21T09:11:14.000Z | tests/gis_tests/geoapp/test_sitemaps.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 12 | 2019-08-10T11:55:29.000Z | 2020-05-21T04:46:30.000Z | tests/gis_tests/geoapp/test_sitemaps.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 3 | 2019-08-20T13:29:34.000Z | 2020-01-30T22:05:10.000Z | import zipfile
from io import BytesIO
from xml.dom import minidom
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .models import City, Country
@modify_settings(
INSTALLED_APPS={"append": ["django.contrib.site... | 37.833333 | 83 | 0.565712 | import zipfile
from io import BytesIO
from xml.dom import minidom
from django.conf import settings
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .models import City, Country
@modify_settings(
INSTALLED_APPS={"append": ["django.contrib.site... | true | true |
7907a85cccd5727c5a24c5f3425a7ad6bf030260 | 141,061 | py | Python | mapclientplugins/parametricfittingstep/resources_rc.py | mahyar-osn/mapclientplugins.parametricfittingstep | 3b78be6a3cbd99f970f0b28c65350304e446c19e | [
"Apache-2.0"
] | null | null | null | mapclientplugins/parametricfittingstep/resources_rc.py | mahyar-osn/mapclientplugins.parametricfittingstep | 3b78be6a3cbd99f970f0b28c65350304e446c19e | [
"Apache-2.0"
] | 2 | 2018-09-28T21:16:39.000Z | 2018-10-11T00:11:58.000Z | mapclientplugins/parametricfittingstep/resources_rc.py | mahyar-osn/mapclientplugins.parametricfittingstep | 3b78be6a3cbd99f970f0b28c65350304e446c19e | [
"Apache-2.0"
] | 2 | 2018-09-21T04:05:54.000Z | 2018-09-28T21:50:32.000Z | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Mon Oct 15 12:53:43 2018
# by: The Resource Compiler for PySide (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore
qt_resource_data = b"\x00\x006x\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x02|\x00\x... | 6,411.863636 | 139,433 | 0.736958 |
from PySide import QtCore
qt_resource_data = b"\x00\x006x\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x02|\x00\x00\x02|\x08\x06\x00\x00\x00d\xed|V\x00\x00\x00\x09pHYs\x00\x00\x17\x12\x00\x00\x17\x12\x01g\x9f\xd2R\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\xc9e<\x00\x006\x05IDATx\xda\xec\xddOl-Y~\... | true | true |
7907aa1c3d3561e8015c2ad6df4b0d971630b5ab | 124,342 | py | Python | tests/model_forms/tests.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 5 | 2021-11-08T13:23:05.000Z | 2022-01-08T09:14:23.000Z | tests/model_forms/tests.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 3 | 2020-01-21T17:58:28.000Z | 2022-03-30T14:16:15.000Z | tests/model_forms/tests.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 2 | 2021-10-13T10:49:28.000Z | 2021-11-30T12:33:33.000Z | import datetime
import os
from decimal import Decimal
from unittest import mock, skipUnless
from django import forms
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import connec... | 39.955656 | 127 | 0.610276 | import datetime
import os
from decimal import Decimal
from unittest import mock, skipUnless
from django import forms
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import connec... | true | true |
7907acab9221c3960723660abcc48d9c5b644763 | 8,945 | py | Python | src/streamlink/plugins/youtube.py | nxkbd/streamlink | 0ba7767c024a6d6086d570e342680dc40c05a57b | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/youtube.py | nxkbd/streamlink | 0ba7767c024a6d6086d570e342680dc40c05a57b | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/youtube.py | nxkbd/streamlink | 0ba7767c024a6d6086d570e342680dc40c05a57b | [
"BSD-2-Clause"
] | null | null | null | import re
from streamlink.compat import urlparse, parse_qsl
from streamlink.plugin import Plugin, PluginError
from streamlink.plugin.api import http, validate
from streamlink.plugin.api.utils import parse_query
from streamlink.stream import HTTPStream, HLSStream
from streamlink.compat import parse_qsl
from streamlink.... | 30.951557 | 101 | 0.541643 | import re
from streamlink.compat import urlparse, parse_qsl
from streamlink.plugin import Plugin, PluginError
from streamlink.plugin.api import http, validate
from streamlink.plugin.api.utils import parse_query
from streamlink.stream import HTTPStream, HLSStream
from streamlink.compat import parse_qsl
from streamlink.... | true | true |
7907acc3377c89435895b694e856fe95c9df31b3 | 15,787 | py | Python | spark_cluster/04_2_HV_basic/HV_v1_NYT_sim1_and_sim3_to_sim2/6200_ML2_HV_v1_NYT_sim1_and_sim3_to_sim2_round5_human_validation.py | poltextlab/nyt_hybrid_classification_workflow | 3f676938b08f4373be3a83e975ee51dfa5ce6bf5 | [
"MIT"
] | null | null | null | spark_cluster/04_2_HV_basic/HV_v1_NYT_sim1_and_sim3_to_sim2/6200_ML2_HV_v1_NYT_sim1_and_sim3_to_sim2_round5_human_validation.py | poltextlab/nyt_hybrid_classification_workflow | 3f676938b08f4373be3a83e975ee51dfa5ce6bf5 | [
"MIT"
] | null | null | null | spark_cluster/04_2_HV_basic/HV_v1_NYT_sim1_and_sim3_to_sim2/6200_ML2_HV_v1_NYT_sim1_and_sim3_to_sim2_round5_human_validation.py | poltextlab/nyt_hybrid_classification_workflow | 3f676938b08f4373be3a83e975ee51dfa5ce6bf5 | [
"MIT"
] | null | null | null | # import libraries
from pyspark.sql import SparkSession
from pyspark import SparkConf
from pyspark.sql.types import *
from pyspark.sql.functions import col, count, lit, rand, when
import pandas as pd
from math import ceil
#################################################
# spark config
##############################... | 44.221289 | 142 | 0.668905 |
from pyspark.sql import SparkSession
from pyspark import SparkConf
from pyspark.sql.types import *
from pyspark.sql.functions import col, count, lit, rand, when
import pandas as pd
from math import ceil
| true | true |
7907ad49a8a35139014ecd6e8154cf8ca8ebc04b | 3,982 | py | Python | slicr/resources/links.py | travisbyrum/slicr | d4d64c102478623022f68632adff070398a8771f | [
"MIT"
] | null | null | null | slicr/resources/links.py | travisbyrum/slicr | d4d64c102478623022f68632adff070398a8771f | [
"MIT"
] | null | null | null | slicr/resources/links.py | travisbyrum/slicr | d4d64c102478623022f68632adff070398a8771f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
slicr.resources.links
~~~~~~~~~~~~~~~~~~~~~
Slicr link resource.
:copyright: © 2018
"""
from flask import current_app
from flask_restful import Resource
from webargs import fields
from webargs.flaskparser import use_args
from slicr.models import Link, LinkSchema
from slicr.utils import c... | 24.732919 | 69 | 0.506781 |
from flask import current_app
from flask_restful import Resource
from webargs import fields
from webargs.flaskparser import use_args
from slicr.models import Link, LinkSchema
from slicr.utils import convert_args
link_args = {
'url': fields.Str(required=True),
'domain_id': fields.Int(missing=None)
}
cla... | true | true |
7907ad6b6a3588c246c97f800ac2258c1c835ccb | 7,922 | py | Python | python/fixrgraph/annotator/acdfgClass.py | LesleyLai/biggroum | e26de363e4bf4645dd5d90121742d3f3533f5a00 | [
"Apache-2.0"
] | 7 | 2019-02-14T17:28:29.000Z | 2021-01-11T07:12:34.000Z | python/fixrgraph/annotator/acdfgClass.py | LesleyLai/biggroum | e26de363e4bf4645dd5d90121742d3f3533f5a00 | [
"Apache-2.0"
] | 23 | 2018-08-19T23:06:54.000Z | 2020-04-14T08:21:05.000Z | python/fixrgraph/annotator/acdfgClass.py | LesleyLai/biggroum | e26de363e4bf4645dd5d90121742d3f3533f5a00 | [
"Apache-2.0"
] | 4 | 2018-06-28T18:22:55.000Z | 2019-03-21T06:36:56.000Z | '''
Acdfg class will have the class definitions for loading
and creating acdfg objects
'''
from __future__ import print_function
try:
from enum import Enum
except ImportError:
from enum34 import Enum
#import proto_acdfg
from protobuf.proto_acdfg_pb2 import Acdfg as ProtoAcdfg
import logging
class NodeType(Enum... | 30.705426 | 97 | 0.611083 | from __future__ import print_function
try:
from enum import Enum
except ImportError:
from enum34 import Enum
from protobuf.proto_acdfg_pb2 import Acdfg as ProtoAcdfg
import logging
class NodeType(Enum):
regular_node = 1
data_node = 2
method_node = 3
class EdgeType(Enum):
control_edge = 1
... | true | true |
7907ad7f651896a977c6f97ab0451c2bb9750752 | 17,894 | py | Python | base2designs/utils/np_box_list_ops_test.py | sethusaim/Automatic-Number-Plate-Recognition | 8b26008f8511e52600b150157901079e0fd0ebfe | [
"MIT"
] | null | null | null | base2designs/utils/np_box_list_ops_test.py | sethusaim/Automatic-Number-Plate-Recognition | 8b26008f8511e52600b150157901079e0fd0ebfe | [
"MIT"
] | null | null | null | base2designs/utils/np_box_list_ops_test.py | sethusaim/Automatic-Number-Plate-Recognition | 8b26008f8511e52600b150157901079e0fd0ebfe | [
"MIT"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.743326 | 88 | 0.555941 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from object_detection.utils import np_box_list
from object_detection.utils import np_box_list_ops
class AreaRelatedTest(tf.test.TestCase):
def s... | true | true |
7907adb19c92d9d0bd748e6b1c7ac20f5b14e6a9 | 4,658 | py | Python | scripts/neural_net_workshop.py | Henrynaut/ML | 47ca3a67948ed8190a31a57d1e9a803ca532938b | [
"MIT"
] | null | null | null | scripts/neural_net_workshop.py | Henrynaut/ML | 47ca3a67948ed8190a31a57d1e9a803ca532938b | [
"MIT"
] | null | null | null | scripts/neural_net_workshop.py | Henrynaut/ML | 47ca3a67948ed8190a31a57d1e9a803ca532938b | [
"MIT"
] | null | null | null | import numpy as np
import random
random.seed(200)
# Create Sigmoid Function
def sig(inp):
return (1/(1+np.exp(-1*inp)))
# For Back Propagation, make Desigmoid function
def dsig(inp):
return (1.0-inp)*inp
# Define class for neuron
class Neuron:
def __init__(self,weights,func,dfunc):
# member varia... | 31.90411 | 83 | 0.572349 | import numpy as np
import random
random.seed(200)
def sig(inp):
return (1/(1+np.exp(-1*inp)))
def dsig(inp):
return (1.0-inp)*inp
class Neuron:
def __init__(self,weights,func,dfunc):
self.weights = weights
self.output = None
self.func = func
self.dfunc... | true | true |
7907adcf781ada4dc3139aa328d65512d51ec61c | 1,772 | py | Python | resources/email.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | resources/email.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | resources/email.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | from flask import current_app, render_template
from flask_restful import Resource, reqparse
from flask_mail import Message
from utils.authorizations import admin_required
from models.user import UserModel
class Email(Resource):
NO_REPLY = "noreply@codeforpdx.org" # Should this be dwellingly address?
parser ... | 33.433962 | 88 | 0.667607 | from flask import current_app, render_template
from flask_restful import Resource, reqparse
from flask_mail import Message
from utils.authorizations import admin_required
from models.user import UserModel
class Email(Resource):
NO_REPLY = "noreply@codeforpdx.org"
parser = reqparse.RequestParser()
parse... | true | true |
7907ae98067bf7e03d8138b9e05d8239fe876567 | 6,882 | py | Python | src/oci/data_integration/models/update_connection_from_amazon_s3.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_integration/models/update_connection_from_amazon_s3.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_integration/models/update_connection_from_amazon_s3.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 39.551724 | 266 | 0.671898 |
from .update_connection_details import UpdateConnectionDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class UpdateConnectionFromAmazonS3(UpdateConnectionDetails):
def ... | true | true |
7907afe8f92afd92f1e31b31284c5a83d00fd630 | 189 | py | Python | zhighlighter.py | herimonster/zoid | 0ee0e5dcc8416c82e82801ba42abf979eacf2db5 | [
"MIT"
] | null | null | null | zhighlighter.py | herimonster/zoid | 0ee0e5dcc8416c82e82801ba42abf979eacf2db5 | [
"MIT"
] | null | null | null | zhighlighter.py | herimonster/zoid | 0ee0e5dcc8416c82e82801ba42abf979eacf2db5 | [
"MIT"
] | null | null | null | import zutils
class zhighlighter:
def highlight(self, text):
return [(zutils.CL_FG, zutils.CL_BG, zutils.AT_BLINK if i % 2 == 0 else zutils.AT_NORMAL) for i in range(len(text))] #LOL!
| 31.5 | 124 | 0.719577 | import zutils
class zhighlighter:
def highlight(self, text):
return [(zutils.CL_FG, zutils.CL_BG, zutils.AT_BLINK if i % 2 == 0 else zutils.AT_NORMAL) for i in range(len(text))]
| true | true |
7907b0900f6d0a61e1cec5291cbe8aa3cc11e186 | 2,585 | py | Python | python/tests/assert.py | mizuki-nana/coreVM | 1ff863b890329265a86ff46b0fdf7bac8e362f0e | [
"MIT"
] | 2 | 2017-02-12T21:59:54.000Z | 2017-02-13T14:57:48.000Z | python/tests/assert.py | mizuki-nana/coreVM | 1ff863b890329265a86ff46b0fdf7bac8e362f0e | [
"MIT"
] | null | null | null | python/tests/assert.py | mizuki-nana/coreVM | 1ff863b890329265a86ff46b0fdf7bac8e362f0e | [
"MIT"
] | null | null | null | # The MIT License (MIT)
# Copyright (c) 2015 Yanzheng Li
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 31.52439 | 80 | 0.572534 |
want to believe.'
except AssertionError:
print 'This should not happen'
ror:
print 'I cannot believe'
+ 1
assert 3.14 - 3.12
assert not False
except AssertionError:
print 'This should not happen'
ionError:
print 'I cannot believe'
tr... | false | true |
7907b1571ae62a26340f878d02efc5e767d62286 | 736 | py | Python | chap8/get_numbers.py | marble-git/python-laoqi | 74c4bb5459113e54ce64443e5da5a9c6a3052d6a | [
"MIT"
] | null | null | null | chap8/get_numbers.py | marble-git/python-laoqi | 74c4bb5459113e54ce64443e5da5a9c6a3052d6a | [
"MIT"
] | null | null | null | chap8/get_numbers.py | marble-git/python-laoqi | 74c4bb5459113e54ce64443e5da5a9c6a3052d6a | [
"MIT"
] | null | null | null | #coding:utf-8
'''
filename:get_numbers.py
chap:8
subject:2
conditions:file [data],contains: numbers,annotations,empty line
solution:function get_numbers
'''
import sys
def get_numbers(file):
f = None
numbers = []
try:
with open(file,'rt') as f:
for line in f:
... | 21.028571 | 67 | 0.569293 |
import sys
def get_numbers(file):
f = None
numbers = []
try:
with open(file,'rt') as f:
for line in f:
try:
numbers.append(int(line))
except ValueError as e:
print('PASS:this line is not pure number:',e)
exc... | true | true |
7907b41746d4436e14fd11921e68dff38fcd1b71 | 888 | py | Python | enaml/widgets/calendar.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | 11 | 2015-03-14T14:30:51.000Z | 2022-03-15T13:01:44.000Z | enaml/widgets/calendar.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | 3 | 2015-01-31T11:12:56.000Z | 2022-03-14T00:53:25.000Z | enaml/widgets/calendar.py | pberkes/enaml | cbcbee929e3117dfe56c0b06dc2385acc832b0e8 | [
"BSD-3-Clause-Clear"
] | 4 | 2015-01-27T01:56:14.000Z | 2021-02-23T07:21:20.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | 31.714286 | 79 | 0.606982 |
from atom.api import Typed, ForwardTyped
from .bounded_date import BoundedDate, ProxyBoundedDate
class ProxyCalendar(ProxyBoundedDate):
declaration = ForwardTyped(lambda: Calendar)
class Calendar(BoundedDate):
proxy = Typed(ProxyCalendar)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.