hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f769c97ebfbbbfb3b1cca00344bf21ac1f4857bc | 37,757 | py | Python | PhloxAR/dc1394/dc_cam.py | jardinier/phlox | f312569ec983b5f27c75846b34debc04fe7bdf98 | [
"Apache-2.0"
] | 1 | 2016-05-22T00:12:14.000Z | 2016-05-22T00:12:14.000Z | PhloxAR/dc1394/dc_cam.py | jardinier/phlox | f312569ec983b5f27c75846b34debc04fe7bdf98 | [
"Apache-2.0"
] | null | null | null | PhloxAR/dc1394/dc_cam.py | jardinier/phlox | f312569ec983b5f27c75846b34debc04fe7bdf98 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
from ctypes import byref, POINTER, c_char, c_uint32, c_float, c_int
from numpy import fromstring, ndarray
from threading import Thread, Lock, Condition
from Queue import Queue
from .core im... | 33.236796 | 80 | 0.578409 |
from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
from ctypes import byref, POINTER, c_char, c_uint32, c_float, c_int
from numpy import fromstring, ndarray
from threading import Thread, Lock, Condition
from Queue import Queue
from .core import *
from .mode import... | true | true |
f769ca43e824c8eec882f25b7bc0eaa07b41d585 | 8,874 | py | Python | pretrain/build_pretraining_dataset.py | cdrhim/KoELECTRA | f2f91adc87cd7fe84280e2cc3b7bc943179e280a | [
"Apache-2.0"
] | 2 | 2020-10-11T15:57:01.000Z | 2020-11-11T13:08:01.000Z | pretrain/build_pretraining_dataset.py | cdrhim/KoELECTRA | f2f91adc87cd7fe84280e2cc3b7bc943179e280a | [
"Apache-2.0"
] | 1 | 2021-08-10T14:53:09.000Z | 2021-08-10T14:53:09.000Z | pretrain/build_pretraining_dataset.py | SIC98/KoELECTRA | 19fd5f2b698b297a8cf1e2c0c3995c93509298f3 | [
"Apache-2.0"
] | 1 | 2021-01-05T10:49:47.000Z | 2021-01-05T10:49:47.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.085837 | 87 | 0.671963 |
import argparse
import multiprocessing
import os
import random
import time
import tensorflow.compat.v1 as tf
from model import tokenization
from util import utils
def create_int_feature(values):
feature = tf.train.Feature(int64_list=tf.train.Int64List(value=list(values)))
return feature
class ExampleBuilder(... | true | true |
f769cbc19e8e29a02396a74b56b01bcc08217c2c | 4,820 | py | Python | gen2-blur-faces/main.py | crisdeodates/AI-depthai-experiments | 74b8b84a03cb637d20a7fcd091cce11add78bd2c | [
"MIT"
] | 1 | 2022-03-07T05:48:42.000Z | 2022-03-07T05:48:42.000Z | gen2-blur-faces/main.py | maxpark/depthai-experiments | dd8a24db648338b8e4d7c9ec6c860985f9aeb56d | [
"MIT"
] | null | null | null | gen2-blur-faces/main.py | maxpark/depthai-experiments | dd8a24db648338b8e4d7c9ec6c860985f9aeb56d | [
"MIT"
] | null | null | null | import blobconverter
import cv2
import depthai as dai
import numpy as np
class HostSync:
def __init__(self):
self.arrays = {}
def add_msg(self, name, msg):
if not name in self.arrays:
self.arrays[name] = []
self.arrays[name].append(msg)
def get_msgs(self, seq):
r... | 39.186992 | 129 | 0.640664 | import blobconverter
import cv2
import depthai as dai
import numpy as np
class HostSync:
def __init__(self):
self.arrays = {}
def add_msg(self, name, msg):
if not name in self.arrays:
self.arrays[name] = []
self.arrays[name].append(msg)
def get_msgs(self, seq):
r... | true | true |
f769ce933ce656f546a6820b92697d371b65718f | 3,347 | py | Python | models/src/modeling/main.py | vbgupta/DS440-Transfer-Learning-Address-Sustainability-Issues | b6ef51fa1e4253e92b8179b1953c43e6b983b944 | [
"MIT"
] | null | null | null | models/src/modeling/main.py | vbgupta/DS440-Transfer-Learning-Address-Sustainability-Issues | b6ef51fa1e4253e92b8179b1953c43e6b983b944 | [
"MIT"
] | null | null | null | models/src/modeling/main.py | vbgupta/DS440-Transfer-Learning-Address-Sustainability-Issues | b6ef51fa1e4253e92b8179b1953c43e6b983b944 | [
"MIT"
] | 1 | 2022-02-05T19:39:59.000Z | 2022-02-05T19:39:59.000Z | #-----Main Model File----#
class Model:
def __init__(self, data):
self.data = data
def preprocess(self):
self.data['License_Class'] = self.data['License_Class'].astype('category').cat.codes
train = self.data[self.data['year'] != 2021]
test = self.data[self.data['year'] == 20... | 35.231579 | 99 | 0.618464 |
class Model:
def __init__(self, data):
self.data = data
def preprocess(self):
self.data['License_Class'] = self.data['License_Class'].astype('category').cat.codes
train = self.data[self.data['year'] != 2021]
test = self.data[self.data['year'] == 2021]
print(f"Train D... | true | true |
f769cee9d016c3c8771a082e07b538e576e91b4d | 1,959 | py | Python | test/test_firmware_cifs_server_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_firmware_cifs_server_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_firmware_cifs_server_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 51.552632 | 1,052 | 0.785094 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.firmware_cifs_server_all_of import FirmwareCifsServerAllOf from intersight.rest import ApiException
class TestFirmwareCifsServerAllOf(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | true | true |
f769cf1ea3bc157f4bb8af83471a3c375fe11fbe | 675 | py | Python | egs/babel/s5b/mykwsutils/hescii-downcase-kwlist.py | Shuang777/kaldi | 3df67141b55cfd5e2ba7305a72e795e7706d8d30 | [
"Apache-2.0"
] | 1 | 2019-02-06T09:31:59.000Z | 2019-02-06T09:31:59.000Z | egs/babel/s5b/mykwsutils/hescii-downcase-kwlist.py | Shuang777/kaldi | 3df67141b55cfd5e2ba7305a72e795e7706d8d30 | [
"Apache-2.0"
] | null | null | null | egs/babel/s5b/mykwsutils/hescii-downcase-kwlist.py | Shuang777/kaldi | 3df67141b55cfd5e2ba7305a72e795e7706d8d30 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Quick and dirty script to convert a .kwlist.xml file to lowercase
# and hescii encode.
#
# Usage: hescii-downcase-kwlist.py infile.kwlist.xml > outfile.kwlist.xml
#
# Changes:
#
# March 12, 2013 Adam Janin
# Hyphens in keywords are not hesciied
import sys
import xml.etree.ElementTree as ET
i... | 21.774194 | 84 | 0.681481 |
import sys
import xml.etree.ElementTree as ET
import hescii
tree = ET.parse(sys.argv[1])
root = tree.getroot()
mixed = 0
for kwtext in root.iter('kwtext'):
lc = kwtext.text.lower()
if lc != kwtext.text:
mixed = mixed + 1
kwtext.text = '-'.join([hescii.dumps(x.encode('utf-8')) for x in lc.split('... | true | true |
f769d0598dd8f4cf5a520369eb6ac16aa5910dd7 | 1,145 | py | Python | casper/__init__.py | jamesray1/casper | 729110527e3fd7b67d9dfd8e48df5d072238b162 | [
"Unlicense"
] | 752 | 2017-04-16T19:11:41.000Z | 2022-02-28T10:52:47.000Z | casper/__init__.py | jamesray1/casper | 729110527e3fd7b67d9dfd8e48df5d072238b162 | [
"Unlicense"
] | 144 | 2017-04-19T14:17:36.000Z | 2019-06-20T15:13:09.000Z | casper/__init__.py | jamesray1/casper | 729110527e3fd7b67d9dfd8e48df5d072238b162 | [
"Unlicense"
] | 214 | 2017-04-17T09:31:00.000Z | 2022-03-28T17:37:59.000Z | # -*- coding: utf-8 -*-
# ############# version ##################
import os.path
import re
import subprocess
from pkg_resources import get_distribution, DistributionNotFound
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_d... | 29.358974 | 99 | 0.603493 | import os.path
import re
import subprocess
from pkg_resources import get_distribution, DistributionNotFound
GIT_DESCRIBE_RE = re.compile('^(?P<version>v\d+\.\d+\.\d+)-(?P<git>\d+-g[a-fA-F0-9]+(?:-dirty)?)$')
__version__ = None
try:
_dist = get_distribution('casper')
dist_loc = os.path.normcase(_dist.loc... | true | true |
f769d108e9f88e6b6f12d73592e968d8320e6361 | 771 | py | Python | dev/generate_image_bb.py | notadamking/ta-modin | e0c2e3b36d21b05798f5ffbb4d30d1898573a375 | [
"MIT"
] | 9 | 2019-08-02T19:14:22.000Z | 2022-01-31T01:27:21.000Z | dev/generate_image_bb.py | notadamking/ta-modin | e0c2e3b36d21b05798f5ffbb4d30d1898573a375 | [
"MIT"
] | null | null | null | dev/generate_image_bb.py | notadamking/ta-modin | e0c2e3b36d21b05798f5ffbb4d30d1898573a375 | [
"MIT"
] | 4 | 2019-07-30T21:46:22.000Z | 2021-04-17T14:51:42.000Z | import numpy as np
import platform
if platform.system() == 'Windows':
import pandas as pd
else:
import modin.pandas as pd
import matplotlib.pyplot as plt
import sys
sys.path.append("..") # Adds higher directory to python modules path.
from ta import *
# Load data
df = pd.read_csv('../data/datas.csv', sep='... | 25.7 | 74 | 0.692607 | import numpy as np
import platform
if platform.system() == 'Windows':
import pandas as pd
else:
import modin.pandas as pd
import matplotlib.pyplot as plt
import sys
sys.path.append("..") from ta import *
df = pd.read_csv('../data/datas.csv', sep=',')
df = utils.dropna(df)
df = add_all_ta_features(df, "Ope... | true | true |
f769d166f22b22827d3c3a2d8107050b8560b120 | 528 | py | Python | dictionary_bs4.py | DravitLochan/Dictionary | 37b2230596a76be25ecb19b7802221d1886d5372 | [
"MIT"
] | null | null | null | dictionary_bs4.py | DravitLochan/Dictionary | 37b2230596a76be25ecb19b7802221d1886d5372 | [
"MIT"
] | null | null | null | dictionary_bs4.py | DravitLochan/Dictionary | 37b2230596a76be25ecb19b7802221d1886d5372 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
def find_meaning(word):
url="http://www.collinsdictionary.com/dictionary/english/"+word
r=requests.get(url)
soup = BeautifulSoup(r.content)
mean= soup.find_all("div",{"class":"sense"})
for item in mean:
try:
# print (item.contents[0].text)
# print (item.co... | 22 | 64 | 0.660985 | import requests
from bs4 import BeautifulSoup
def find_meaning(word):
url="http://www.collinsdictionary.com/dictionary/english/"+word
r=requests.get(url)
soup = BeautifulSoup(r.content)
mean= soup.find_all("div",{"class":"sense"})
for item in mean:
try:
str = item.contents[2].text
... | true | true |
f769d19de22429d48ab0b8af03337533cd377cac | 4,880 | py | Python | api/api.py | RicoFio/5294BIDA6Y_tech_tutorial | a9f966d6022f5d7941100a377d7f9c5face71f00 | [
"MIT"
] | null | null | null | api/api.py | RicoFio/5294BIDA6Y_tech_tutorial | a9f966d6022f5d7941100a377d7f9c5face71f00 | [
"MIT"
] | null | null | null | api/api.py | RicoFio/5294BIDA6Y_tech_tutorial | a9f966d6022f5d7941100a377d7f9c5face71f00 | [
"MIT"
] | null | null | null | ### IMPORTS ###
import os
import time
from typing import (
List,
Dict,
Union,
)
import threading
import uuid
import numpy as np
from pydantic import (
BaseModel,
validator,
Field,
)
from fastapi import (
FastAPI,
Response,
status,
)
from fastapi.middleware.cors import CORSMiddlewar... | 24.522613 | 101 | 0.627459 | import os
import time
from typing import (
List,
Dict,
Union,
)
import threading
import uuid
import numpy as np
from pydantic import (
BaseModel,
validator,
Field,
)
from fastapi import (
FastAPI,
Response,
status,
)
from fastapi.middleware.cors import CORSMiddleware
import diskca... | true | true |
f769d1c6d9d0a64436615b9f4c5d89091e407240 | 1,767 | py | Python | domains/explore/problems/training/problem252_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | domains/explore/problems/training/problem252_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | domains/explore/problems/training/problem252_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | 28.967213 | 221 | 0.487832 | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | true | true |
f769d2bc4ffba19def931f06868efb91e3278ba4 | 11,914 | py | Python | homeassistant/components/http/__init__.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/http/__init__.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/http/__init__.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | null | null | null | """
This module provides WSGI application to serve the Home Assistant API.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/http/
"""
from ipaddress import ip_network
import logging
import os
import ssl
from aiohttp import web
from aiohttp.web_exceptions... | 36.212766 | 79 | 0.667114 | from ipaddress import ip_network
import logging
import os
import ssl
from aiohttp import web
from aiohttp.web_exceptions import HTTPMovedPermanently
import voluptuous as vol
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, SERVER_PORT)
import homeassistant.helpers.config_vali... | true | true |
f769d34c8b7514513e57770a5bb10df3a91cb48b | 135 | py | Python | comments/admin.py | parsampsh/besanj-django | 0ebc3e4294c9c004ffc882353f4fbba724f07b1a | [
"MIT"
] | 2 | 2022-03-26T07:48:57.000Z | 2022-03-28T12:46:15.000Z | comments/admin.py | parsampsh/besanj-django | 0ebc3e4294c9c004ffc882353f4fbba724f07b1a | [
"MIT"
] | null | null | null | comments/admin.py | parsampsh/besanj-django | 0ebc3e4294c9c004ffc882353f4fbba724f07b1a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Comment
@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
pass
| 16.875 | 37 | 0.792593 | from django.contrib import admin
from .models import Comment
@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
pass
| true | true |
f769d3cd831ac13f5eba864115120c8303dc3201 | 4,716 | py | Python | modules/UR_module/src/scheduler.py | Fortuz/MARG_project | a83aa84ac001ff7cad93934a3ea8bbd05901d992 | [
"MIT"
] | null | null | null | modules/UR_module/src/scheduler.py | Fortuz/MARG_project | a83aa84ac001ff7cad93934a3ea8bbd05901d992 | [
"MIT"
] | null | null | null | modules/UR_module/src/scheduler.py | Fortuz/MARG_project | a83aa84ac001ff7cad93934a3ea8bbd05901d992 | [
"MIT"
] | null | null | null | #encoding: utf-8
import numpy as np
from RTDEhandler import RTDEhandler
from URconnect import URCom
import socket
from threading import Thread
import time
from queue import Queue
class scheduler:
def __init__(self, robotip):
self.robot=URCom(robotip,30002)
self.servsock=socket.socket(so... | 32.979021 | 101 | 0.549194 | import numpy as np
from RTDEhandler import RTDEhandler
from URconnect import URCom
import socket
from threading import Thread
import time
from queue import Queue
class scheduler:
def __init__(self, robotip):
self.robot=URCom(robotip,30002)
self.servsock=socket.socket(socket.AF_INET, sock... | true | true |
f769d4e0b81d3800d854a20b9dbf45d586736bc3 | 1,359 | py | Python | app/FrontendMicroservice/service_calls/call_user_service.py | AdavisSnakes/GrocerySaaS | 1d0b50d1c0d2e53b1bdb9fe57e94c6168b7e4c84 | [
"MIT"
] | null | null | null | app/FrontendMicroservice/service_calls/call_user_service.py | AdavisSnakes/GrocerySaaS | 1d0b50d1c0d2e53b1bdb9fe57e94c6168b7e4c84 | [
"MIT"
] | null | null | null | app/FrontendMicroservice/service_calls/call_user_service.py | AdavisSnakes/GrocerySaaS | 1d0b50d1c0d2e53b1bdb9fe57e94c6168b7e4c84 | [
"MIT"
] | null | null | null | from flask import Flask, Blueprint, request, current_app
from flask_login import login_user
from notifications import Notifications, db
from user import User
import json, requests
from datetime import datetime
user_api = Blueprint('user_api', __name__)
@user_api.route("/signup", methods=["POST"])
def signup():
da... | 31.604651 | 132 | 0.650478 | from flask import Flask, Blueprint, request, current_app
from flask_login import login_user
from notifications import Notifications, db
from user import User
import json, requests
from datetime import datetime
user_api = Blueprint('user_api', __name__)
@user_api.route("/signup", methods=["POST"])
def signup():
da... | true | true |
f769d55314d9d71ee877ba45dc159dc9c902d526 | 2,977 | py | Python | tests/s3_access_log_aggregator/test_aggregate_to_db.py | oslokommune/dataplatform-batch-jobs | c6f2a31d86676dae62bbdcd8822c6f9320c9aec2 | [
"MIT"
] | null | null | null | tests/s3_access_log_aggregator/test_aggregate_to_db.py | oslokommune/dataplatform-batch-jobs | c6f2a31d86676dae62bbdcd8822c6f9320c9aec2 | [
"MIT"
] | 2 | 2022-01-10T08:22:50.000Z | 2022-02-08T10:32:36.000Z | tests/s3_access_log_aggregator/test_aggregate_to_db.py | oslokommune/dataplatform-batch-jobs | c6f2a31d86676dae62bbdcd8822c6f9320c9aec2 | [
"MIT"
] | null | null | null | from io import BytesIO
from unittest.mock import Mock
import pandas as pd
from fastparquet import write as pq_write
from batch.models import DatasetRetrievals
from batch.s3_access_log_aggregator.aggregate_to_db import (
count_get_requests,
aggregate_to_db,
read_parquet,
)
def test_read_parquet():
in... | 31.670213 | 88 | 0.66006 | from io import BytesIO
from unittest.mock import Mock
import pandas as pd
from fastparquet import write as pq_write
from batch.models import DatasetRetrievals
from batch.s3_access_log_aggregator.aggregate_to_db import (
count_get_requests,
aggregate_to_db,
read_parquet,
)
def test_read_parquet():
in... | true | true |
f769d5aa31bc7b06a5d280672346711ef315ceb5 | 5,036 | py | Python | app/api/routes/analysis_module_type.py | hollyfoxx/ace2-ams-api | 08ecf3f3dc8ac9abd224465731458950d4f78b7d | [
"Apache-2.0"
] | null | null | null | app/api/routes/analysis_module_type.py | hollyfoxx/ace2-ams-api | 08ecf3f3dc8ac9abd224465731458950d4f78b7d | [
"Apache-2.0"
] | null | null | null | app/api/routes/analysis_module_type.py | hollyfoxx/ace2-ams-api | 08ecf3f3dc8ac9abd224465731458950d4f78b7d | [
"Apache-2.0"
] | null | null | null | from fastapi import APIRouter, Depends, Request, Response
from sqlalchemy.orm import Session
from typing import List
from uuid import UUID
from api.models.analysis_module_type import (
AnalysisModuleTypeCreate,
AnalysisModuleTypeRead,
AnalysisModuleTypeUpdate,
)
from api.routes import helpers
from db impor... | 32.076433 | 114 | 0.76112 | from fastapi import APIRouter, Depends, Request, Response
from sqlalchemy.orm import Session
from typing import List
from uuid import UUID
from api.models.analysis_module_type import (
AnalysisModuleTypeCreate,
AnalysisModuleTypeRead,
AnalysisModuleTypeUpdate,
)
from api.routes import helpers
from db impor... | true | true |
f769d60794a8c1e8ab93b110b65091197c8b2477 | 2,807 | py | Python | test_function.py | njpaul/mke_sanitation | 9846b15ffca7d729811aeffed45cc933e77681ab | [
"MIT"
] | null | null | null | test_function.py | njpaul/mke_sanitation | 9846b15ffca7d729811aeffed45cc933e77681ab | [
"MIT"
] | 2 | 2020-03-21T18:05:54.000Z | 2020-03-21T18:06:34.000Z | test_function.py | njpaul/mke_sanitation | 9846b15ffca7d729811aeffed45cc933e77681ab | [
"MIT"
] | null | null | null | import unittest
from datetime import date
from function import *
from sanitation import UnknownCollectionDate
class TestCollDateToSpeech(unittest.TestCase):
def test_raises_UnknownCollectionDate_when_in_past(self):
now = date(2019, 4, 22)
coll_date = date(2019, 4, 21)
with self.assertRai... | 35.531646 | 85 | 0.600285 | import unittest
from datetime import date
from function import *
from sanitation import UnknownCollectionDate
class TestCollDateToSpeech(unittest.TestCase):
def test_raises_UnknownCollectionDate_when_in_past(self):
now = date(2019, 4, 22)
coll_date = date(2019, 4, 21)
with self.assertRai... | true | true |
f769d78c8c33c8a0e1a75df73ca44f91ae6e8e4d | 667 | py | Python | Data Scientist Career Path/7. Summary Statistics/1. Variable Types/6. alter.py | myarist/Codecademy | 2ba0f104bc67ab6ef0f8fb869aa12aa02f5f1efb | [
"MIT"
] | 23 | 2021-06-06T15:35:55.000Z | 2022-03-21T06:53:42.000Z | Data Scientist Career Path/7. Summary Statistics/1. Variable Types/6. alter.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | null | null | null | Data Scientist Career Path/7. Summary Statistics/1. Variable Types/6. alter.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | 9 | 2021-06-08T01:32:04.000Z | 2022-03-18T15:38:09.000Z | import codecademylib3
# Import pandas with alias
import pandas as pd
# Import dataset as a Pandas Dataframe
movies = pd.read_csv("movie_show.csv", index_col=0)
# Print the first five rows of the dataframe
print(movies.head())
# Print the data types of the dataframe
print(movies.dtypes)
# Replace any missing values... | 26.68 | 74 | 0.766117 | import codecademylib3
import pandas as pd
movies = pd.read_csv("movie_show.csv", index_col=0)
print(movies.head())
print(movies.dtypes)
movies['release_year'] = movies['release_year'].replace(['missing'], 2019)
movies['release_year'] = pd.to_numeric(movies['release_year'])
print(movies.dtypes)
print(movies['rel... | true | true |
f769d7d8da2c299fa64d93412293bfee7f3b9606 | 271 | py | Python | python/hard_python/guess/592/method.py | ii6uu99/ipynb | d924a6926838ca5e563620cd324368a07d2c2521 | [
"MIT"
] | 1 | 2021-01-27T09:01:33.000Z | 2021-01-27T09:01:33.000Z | python/hard_python/guess/592/method.py | ii6uu99/ipynb | d924a6926838ca5e563620cd324368a07d2c2521 | [
"MIT"
] | null | null | null | python/hard_python/guess/592/method.py | ii6uu99/ipynb | d924a6926838ca5e563620cd324368a07d2c2521 | [
"MIT"
] | 1 | 2021-01-26T13:22:21.000Z | 2021-01-26T13:22:21.000Z | #函数的3要素:名字, 参数,返回值
def bmi(height, weight):
"""计算BMI的值:
公式: 身高/(体重*体重)。
身高是以米为单位,如1.78
体重是以公斤为单位,如62公斤
函数返回计算好的BMI值,保留1位小数
"""
bmi_value = weight/(height*height)
return round(bmi_value, 1)
print(bmi.__doc__)
print(round.__doc__)
#print(bmi(1.68, 72)) | 19.357143 | 35 | 0.675277 | def bmi(height, weight):
bmi_value = weight/(height*height)
return round(bmi_value, 1)
print(bmi.__doc__)
print(round.__doc__)
| true | true |
f769d873fdb0d4bca955da3b31349e62115ffa44 | 3,249 | py | Python | scripts/update-mathlib.py | fpvandoorn/mathlib | b3433a51ea8bc07c4159c1073838fc0ee9b8f227 | [
"Apache-2.0"
] | 5 | 2019-05-29T06:39:26.000Z | 2022-03-21T12:47:46.000Z | scripts/update-mathlib.py | fpvandoorn/mathlib | b3433a51ea8bc07c4159c1073838fc0ee9b8f227 | [
"Apache-2.0"
] | 1 | 2019-03-15T13:44:08.000Z | 2019-03-15T13:44:08.000Z | scripts/update-mathlib.py | fpvandoorn/mathlib | b3433a51ea8bc07c4159c1073838fc0ee9b8f227 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os.path
import os
import sys
from github import Github
from git import Repo, InvalidGitRepositoryError
import toml
import urllib3
import certifi
import configparser
import tarfile
import signal
from delayed_interrupt import DelayedInterrupt
from auth_github import auth_github
self_update... | 31.852941 | 84 | 0.627578 |
import os.path
import os
import sys
from github import Github
from git import Repo, InvalidGitRepositoryError
import toml
import urllib3
import certifi
import configparser
import tarfile
import signal
from delayed_interrupt import DelayedInterrupt
from auth_github import auth_github
self_update = '--self-update' in s... | true | true |
f769d899d382c106e01f9388e29e117d237c0305 | 4,772 | py | Python | torch_optimizer/adamod.py | tkon3/pytorch-optimizer | e5578453b79143331c30fd76b08721b45dce86d3 | [
"Apache-2.0"
] | 2 | 2021-05-06T15:07:16.000Z | 2021-10-20T14:39:09.000Z | torch_optimizer/adamod.py | tkon3/pytorch-optimizer | e5578453b79143331c30fd76b08721b45dce86d3 | [
"Apache-2.0"
] | null | null | null | torch_optimizer/adamod.py | tkon3/pytorch-optimizer | e5578453b79143331c30fd76b08721b45dce86d3 | [
"Apache-2.0"
] | null | null | null | import math
import torch
from torch.optim.optimizer import Optimizer
from .types import Betas2, OptFloat, OptLossClosure, Params
__all__ = ('AdaMod',)
class AdaMod(Optimizer):
r"""Implements AccSGD algorithm.
It has been proposed in `Adaptive and Momental Bounds for Adaptive
Learning Rate Methods`__.
... | 35.61194 | 79 | 0.538768 | import math
import torch
from torch.optim.optimizer import Optimizer
from .types import Betas2, OptFloat, OptLossClosure, Params
__all__ = ('AdaMod',)
class AdaMod(Optimizer):
def __init__(
self,
params: Params,
lr: float = 1e-3,
betas: Betas2 = (0.9, 0.999),
beta3: flo... | true | true |
f769d89f8bdf35b4e2b6084b1f0fb8b8a748a22f | 1,448 | py | Python | django_get_started/urls.py | rechadson/devops-ac06 | a1bb0694565a559afa77d5edf23d2d496249d1c8 | [
"MIT"
] | null | null | null | django_get_started/urls.py | rechadson/devops-ac06 | a1bb0694565a559afa77d5edf23d2d496249d1c8 | [
"MIT"
] | 40 | 2018-05-12T00:46:46.000Z | 2018-05-18T17:53:41.000Z | django_get_started/urls.py | rechadson/devops-ac06 | a1bb0694565a559afa77d5edf23d2d496249d1c8 | [
"MIT"
] | null | null | null | """
Definition of urls for django_get_started.
"""
from datetime import datetime
from django.conf.urls import patterns, url
from app.forms import BootstrapAuthenticationForm
# Uncomment the next lines to enable the admin:
# from django.conf.urls import include
# from django.contrib import admin
# admin.autodiscover()... | 31.478261 | 100 | 0.618094 |
from datetime import datetime
from django.conf.urls import patterns, url
from app.forms import BootstrapAuthenticationForm
urlpatterns = patterns('',
url(r'^cadastro_vestibulares', 'app.views.cadastro_vestibulares', name='cadastro_vestibulares'),
url(r'^$', 'app.views.home', name='home'),
url(r'^cont... | true | true |
f769daa4b0e83214bf8063f5c548f6c53a5084d3 | 1,320 | py | Python | organisations/notifications.py | City-of-Helsinki/palvelutarjotin | 4ad67cbf4062832aba8080cb96ac785bdbbe9aa8 | [
"MIT"
] | 2 | 2020-11-10T16:31:26.000Z | 2021-02-19T10:33:27.000Z | organisations/notifications.py | City-of-Helsinki/palvelutarjotin | 4ad67cbf4062832aba8080cb96ac785bdbbe9aa8 | [
"MIT"
] | 239 | 2020-04-23T07:36:17.000Z | 2022-03-15T08:38:38.000Z | organisations/notifications.py | City-of-Helsinki/palvelutarjotin | 4ad67cbf4062832aba8080cb96ac785bdbbe9aa8 | [
"MIT"
] | null | null | null | from django.utils.translation import gettext_lazy as _
from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications
from organisations.consts import NotificationTemplate
from organisations.factories import (
OrganisationFactory,
OrganisationProposalFactory,
Pers... | 32.195122 | 78 | 0.746212 | from django.utils.translation import gettext_lazy as _
from django_ilmoitin.dummy_context import dummy_context
from django_ilmoitin.registry import notifications
from organisations.consts import NotificationTemplate
from organisations.factories import (
OrganisationFactory,
OrganisationProposalFactory,
Pers... | true | true |
f769dabfb0e9b618475357594080214c58ef90cb | 8,495 | py | Python | modules/photons_canvas/animations/runner.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 51 | 2020-07-03T08:34:48.000Z | 2022-03-16T10:56:08.000Z | modules/photons_canvas/animations/runner.py | delfick/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 81 | 2020-07-03T08:13:59.000Z | 2022-03-31T23:02:54.000Z | modules/photons_canvas/animations/runner.py | Djelibeybi/photons | bc0aa91771d8e88fd3c691fb58f18cb876f292ec | [
"MIT"
] | 8 | 2020-07-24T23:48:20.000Z | 2021-05-24T17:20:16.000Z | from photons_canvas.animations.infrastructure.finish import Finish
from photons_canvas.animations.run_options import make_run_options
from photons_canvas.animations.infrastructure.state import State
from photons_canvas.animations.infrastructure import cannons
from photons_canvas import Canvas
from photons_app.special ... | 36.934783 | 100 | 0.556327 | from photons_canvas.animations.infrastructure.finish import Finish
from photons_canvas.animations.run_options import make_run_options
from photons_canvas.animations.infrastructure.state import State
from photons_canvas.animations.infrastructure import cannons
from photons_canvas import Canvas
from photons_app.special ... | true | true |
f769dba086fb446f290da5b384a799382968e360 | 68 | py | Python | theheck/specific/dnf.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | theheck/specific/dnf.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | theheck/specific/dnf.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | from theheck.utils import which
dnf_available = bool(which('dnf'))
| 17 | 34 | 0.764706 | from theheck.utils import which
dnf_available = bool(which('dnf'))
| true | true |
f769dcf4d73069139c0e2148539bc7790196fa06 | 5,880 | py | Python | allennlp/allennlp/data/token_indexers/elmo_indexer.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | allennlp/allennlp/data/token_indexers/elmo_indexer.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | allennlp/allennlp/data/token_indexers/elmo_indexer.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | from typing import Dict, List
from overrides import overrides
import torch
from allennlp.common.checks import ConfigurationError
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.tokenizers.token import Token
from allennlp.data.token_indexers.token_indexer import TokenIndexer, IndexedTokenLis... | 35.636364 | 112 | 0.67619 | from typing import Dict, List
from overrides import overrides
import torch
from allennlp.common.checks import ConfigurationError
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.tokenizers.token import Token
from allennlp.data.token_indexers.token_indexer import TokenIndexer, IndexedTokenLis... | true | true |
f769dd25bccdc94897f050cf928fdc9e1112f8d5 | 858 | py | Python | caseworker/core/decorators.py | django-doctor/lite-frontend | 330ff9575fd22d7c4c42698ac2d653244e6180d6 | [
"MIT"
] | 1 | 2021-10-16T16:36:58.000Z | 2021-10-16T16:36:58.000Z | caseworker/core/decorators.py | django-doctor/lite-frontend | 330ff9575fd22d7c4c42698ac2d653244e6180d6 | [
"MIT"
] | 45 | 2020-08-11T14:37:46.000Z | 2022-03-29T17:03:02.000Z | caseworker/core/decorators.py | django-doctor/lite-frontend | 330ff9575fd22d7c4c42698ac2d653244e6180d6 | [
"MIT"
] | 3 | 2021-02-01T06:26:19.000Z | 2022-02-21T23:02:46.000Z | from django.utils.functional import wraps
from caseworker.core.constants import Permission
from core.exceptions import PermissionDeniedError
from caseworker.core import helpers
def has_permission(permission: Permission):
"""
Decorator for views that checks that the user has a given permission
"""
de... | 30.642857 | 84 | 0.665501 | from django.utils.functional import wraps
from caseworker.core.constants import Permission
from core.exceptions import PermissionDeniedError
from caseworker.core import helpers
def has_permission(permission: Permission):
def decorator(view_func):
@wraps(view_func)
def _wrapped_view(request, *arg... | true | true |
f769de5ddd8dc7d86ed42bbac7d607ebe7814da5 | 411 | py | Python | timers/pygame.py | misspellted/enlightened | 59fac50bb17a5a3236a9b4561b5ed0107825fb85 | [
"Unlicense"
] | 2 | 2021-03-03T05:57:51.000Z | 2021-07-06T06:26:07.000Z | timers/pygame.py | misspellted/enlightened | 59fac50bb17a5a3236a9b4561b5ed0107825fb85 | [
"Unlicense"
] | 6 | 2021-04-09T00:30:24.000Z | 2022-03-14T16:08:37.000Z | timers/pygame.py | misspellted/enlightened | 59fac50bb17a5a3236a9b4561b5ed0107825fb85 | [
"Unlicense"
] | 1 | 2021-03-03T06:00:46.000Z | 2021-03-03T06:00:46.000Z |
from measurements import Measurement
from pygame.time import get_ticks
from timers import Timer
from units.time import Second
from units.prefixes.small import Milli
class PyGameTimer(Timer):
def __init__(self):
Timer.__init__(self)
def time(self):
measurement = Measurement(1, Second()).convertTo(Milli(... | 21.631579 | 63 | 0.759124 |
from measurements import Measurement
from pygame.time import get_ticks
from timers import Timer
from units.time import Second
from units.prefixes.small import Milli
class PyGameTimer(Timer):
def __init__(self):
Timer.__init__(self)
def time(self):
measurement = Measurement(1, Second()).convertTo(Milli(... | true | true |
f769e03a690472da5dc88763cebf8a07ad63c36d | 4,430 | py | Python | experiments/ashvin/vae/old/pointmass/test_vae.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/vae/old/pointmass/test_vae.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/ashvin/vae/old/pointmass/test_vae.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | from railrl.envs.multitask.multitask_env import MultitaskToFlatEnv
from railrl.envs.multitask.point2d import MultitaskImagePoint2DEnv
from railrl.envs.mujoco.pusher2d import Pusher2DEnv
from railrl.envs.wrappers import NormalizedBoxEnv
from railrl.exploration_strategies.base import (
PolicyWrappedWithExplorationStr... | 31.642857 | 96 | 0.654628 | from railrl.envs.multitask.multitask_env import MultitaskToFlatEnv
from railrl.envs.multitask.point2d import MultitaskImagePoint2DEnv
from railrl.envs.mujoco.pusher2d import Pusher2DEnv
from railrl.envs.wrappers import NormalizedBoxEnv
from railrl.exploration_strategies.base import (
PolicyWrappedWithExplorationStr... | true | true |
f769e03ff46166b06fb3de455fa0af7fadeee44a | 1,695 | py | Python | TheSpider/TheSpider/spiders/thespider.py | rakibulislam01/web-scraping | eddb44fd28dad8dbe6bdee8d10e2d4228e4b1839 | [
"MIT"
] | 2 | 2020-01-04T04:22:44.000Z | 2021-05-12T07:16:38.000Z | TheSpider/TheSpider/spiders/thespider.py | rakibulislam01/web-scraping | eddb44fd28dad8dbe6bdee8d10e2d4228e4b1839 | [
"MIT"
] | 3 | 2021-03-31T19:30:59.000Z | 2022-02-11T03:43:38.000Z | TheSpider/TheSpider/spiders/thespider.py | rakibulislam01/web-scraping | eddb44fd28dad8dbe6bdee8d10e2d4228e4b1839 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
# pages = int(input('How Many Pages Do You Want to Scrape: '))
pages = 1
dictonary = {'One': 1, 'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5}
class ThespiderSpider(scrapy.Spider):
name = 'books'
# allowed_domains = ['book.toscrape.com']
start_urls = ['http://books.tosc... | 43.461538 | 120 | 0.529204 | import scrapy
pages = 1
dictonary = {'One': 1, 'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5}
class ThespiderSpider(scrapy.Spider):
name = 'books'
start_urls = ['http://books.toscrape.com/catalogue/page-{}.html'.format(i + 1) for i in range(pages)]
# def parse(self, response):
# data = {}
... | true | true |
f769e0ca135ff0a81d0b7284272d44057f396285 | 2,261 | py | Python | src/barabasi_benchmark/benchmark-dan3.py | wahur666/DAN-Demo | 0dcf553b3e3b8ea300e828dd2d90688fc2774d0a | [
"Apache-2.0"
] | 4 | 2019-08-18T18:39:37.000Z | 2019-11-24T19:22:15.000Z | src/barabasi_benchmark/benchmark-dan3.py | wahur666/DAN-Demo | 0dcf553b3e3b8ea300e828dd2d90688fc2774d0a | [
"Apache-2.0"
] | null | null | null | src/barabasi_benchmark/benchmark-dan3.py | wahur666/DAN-Demo | 0dcf553b3e3b8ea300e828dd2d90688fc2774d0a | [
"Apache-2.0"
] | null | null | null | import csv
import multiprocessing as mp
import os
from common import timeit, load_configurations, create_demand_matrix_for_configuration
from network import BfsDanNetwork
FIG_NUM = 0
@timeit
def main(show=False):
configurations = load_configurations("../config.json")
active_config = configurations[1]
re... | 30.972603 | 112 | 0.599735 | import csv
import multiprocessing as mp
import os
from common import timeit, load_configurations, create_demand_matrix_for_configuration
from network import BfsDanNetwork
FIG_NUM = 0
@timeit
def main(show=False):
configurations = load_configurations("../config.json")
active_config = configurations[1]
re... | true | true |
f769e0f7b0ea71ea2370b6b607899557fae0f4e9 | 4,202 | py | Python | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/sdk/devtestlabs/models/artifact_source.py | saurabsa/azure-cli-old | f77477a98c9aa9cb55daf5b0d2f410d1455a9225 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/sdk/devtestlabs/models/artifact_source.py | saurabsa/azure-cli-old | f77477a98c9aa9cb55daf5b0d2f410d1455a9225 | [
"MIT"
] | 2 | 2021-03-25T21:38:56.000Z | 2021-11-15T17:46:45.000Z | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/sdk/devtestlabs/models/artifact_source.py | Visual-Studio-China/azure-cli-int | 48c7c7f371a0ecc4ebfd4dcfdc72764beddf5c31 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------... | 46.175824 | 295 | 0.637554 | from msrest.serialization import Model
class ArtifactSource(Model):
_attribute_map = {
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'uri': {'key': 'properties.uri', 'type': 'str'},
'source_type': {'key': 'properties.sourceType', 'type': 'str'},
'folder_path': ... | true | true |
f769e211589e6addc5c14f277df6d66083cd0d85 | 3,988 | py | Python | peal/operators/reproduction.py | alienkrieg/peal | 66b48c0f3973c7f3bceece64dc6e896c9802e29a | [
"MIT"
] | 1 | 2021-12-26T18:24:07.000Z | 2021-12-26T18:24:07.000Z | peal/operators/reproduction.py | alienkrieg/peal | 66b48c0f3973c7f3bceece64dc6e896c9802e29a | [
"MIT"
] | null | null | null | peal/operators/reproduction.py | alienkrieg/peal | 66b48c0f3973c7f3bceece64dc6e896c9802e29a | [
"MIT"
] | null | null | null | """Module that provides operators that reproduce individuals."""
import numpy as np
from peal.community import Community
from peal.operators.iteration import (
SingleIteration,
RandomStraightIteration,
)
from peal.operators.operator import Operator
from peal.population import Population
class Copy(Operator)... | 30.676923 | 74 | 0.590271 |
import numpy as np
from peal.community import Community
from peal.operators.iteration import (
SingleIteration,
RandomStraightIteration,
)
from peal.operators.operator import Operator
from peal.population import Population
class Copy(Operator):
def __init__(self):
super().__init__(iter_type=Sin... | true | true |
f769e28f809db56c44e866a02f5ba65055af3283 | 25,444 | py | Python | nesp_lib/pump.py | c0deba5e/nesp-lib-py | 2e08a530c9d52c9eb25bfc955c038adb1999377a | [
"MIT"
] | null | null | null | nesp_lib/pump.py | c0deba5e/nesp-lib-py | 2e08a530c9d52c9eb25bfc955c038adb1999377a | [
"MIT"
] | 1 | 2021-11-30T01:41:07.000Z | 2021-12-01T01:06:10.000Z | nesp_lib/pump.py | c0deba5e/nesp-lib-py | 2e08a530c9d52c9eb25bfc955c038adb1999377a | [
"MIT"
] | 1 | 2021-12-30T22:35:51.000Z | 2021-12-30T22:35:51.000Z | from .port import Port
from .status import Status
from .alarm_status import AlarmStatus
from .pumping_direction import PumpingDirection
from .exceptions import *
import typing
import binascii
import re
import time
import enum
import threading
class Pump :
"""Pump."""
MODEL_NUMBER_IGNORE = 0
... | 36.296719 | 100 | 0.599434 | from .port import Port
from .status import Status
from .alarm_status import AlarmStatus
from .pumping_direction import PumpingDirection
from .exceptions import *
import typing
import binascii
import re
import time
import enum
import threading
class Pump :
MODEL_NUMBER_IGNORE = 0
ADDRESS_DEF... | true | true |
f769e3d2b91172f10256308945a2be91bd20b83e | 10,043 | py | Python | lib/fast_rcnn/config.py | ChisenZhang/Curve-Text-Detector | 2126a660d3baf3e84a76e77352597576519c35a2 | [
"RSA-MD"
] | 627 | 2017-12-05T11:22:47.000Z | 2022-03-25T06:10:25.000Z | lib/fast_rcnn/config.py | ChisenZhang/Curve-Text-Detector | 2126a660d3baf3e84a76e77352597576519c35a2 | [
"RSA-MD"
] | 56 | 2017-12-11T07:19:52.000Z | 2022-03-01T11:46:02.000Z | lib/fast_rcnn/config.py | ChisenZhang/Curve-Text-Detector | 2126a660d3baf3e84a76e77352597576519c35a2 | [
"RSA-MD"
] | 165 | 2017-12-07T08:22:59.000Z | 2022-02-27T04:52:51.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Fast R-CNN config system.
This file specifies default config option... | 32.927869 | 198 | 0.680374 |
import os
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config import cfg
cfg = __C
#
# Training options
#
__C.TRAIN = edict()
# Scales to use during training (can list multiple scales)
# Each scale is the pixel size... | true | true |
f769e572575730a2e878e0f94cb2a8e70ec8cbb7 | 8,604 | py | Python | tests/unit/local/layers/test_download_layers.py | torresxb1/aws-sam-cli | d307f2eb6e1a91a476a5e2ca6070f974b0c913f1 | [
"BSD-2-Clause",
"Apache-2.0"
] | 2,959 | 2018-05-08T21:48:56.000Z | 2020-08-24T14:35:39.000Z | tests/unit/local/layers/test_download_layers.py | torresxb1/aws-sam-cli | d307f2eb6e1a91a476a5e2ca6070f974b0c913f1 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1,469 | 2018-05-08T22:44:28.000Z | 2020-08-24T20:19:24.000Z | tests/unit/local/layers/test_download_layers.py | torresxb1/aws-sam-cli | d307f2eb6e1a91a476a5e2ca6070f974b0c913f1 | [
"BSD-2-Clause",
"Apache-2.0"
] | 642 | 2018-05-08T22:09:19.000Z | 2020-08-17T09:04:37.000Z | import os
from unittest import TestCase
from unittest.mock import Mock, call, patch
from botocore.exceptions import NoCredentialsError, ClientError
from pathlib import Path
from parameterized import parameterized
from samcli.local.layers.layer_downloader import LayerDownloader
from samcli.commands.local.cli_common.u... | 39.287671 | 105 | 0.70351 | import os
from unittest import TestCase
from unittest.mock import Mock, call, patch
from botocore.exceptions import NoCredentialsError, ClientError
from pathlib import Path
from parameterized import parameterized
from samcli.local.layers.layer_downloader import LayerDownloader
from samcli.commands.local.cli_common.u... | true | true |
f769e5af4b0228539d389c44c8ca0c1092ae21be | 1,482 | py | Python | pcat2py/class/22f7e138-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/22f7e138-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | pcat2py/class/22f7e138-5cc5-11e4-af55-00155d01fe08.py | phnomcobra/PCAT2PY | 937c3b365cdc5ac69b78f59070be0a21bdb53db0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
################################################################################
# 22f7e138-5cc5-11e4-af55-00155d01fe08
#
# Justin Dierking
# justindierking@hardbitsolutions.com
# phnomcobra@gmail.com
#
# 10/24/2014 Original Construction
################################################################... | 39 | 161 | 0.607962 |
class Finding:
def __init__(self):
self.output = []
self.is_compliant = False
self.uuid = "22f7e138-5cc5-11e4-af55-00155d01fe08"
def check(self, cli):
self.is_compliant = False
dword = cli.get_reg_dword(r'HKCU:\Software\Policies\Microsoft\Office... | true | true |
f769e634d584efa6701242e1229fec89827c4dd9 | 456 | py | Python | zenithml/__init__.py | zenith-ml/zenithml | b2e68d31f9649d5477f8321b4394822f6f3a8e0c | [
"MIT"
] | null | null | null | zenithml/__init__.py | zenith-ml/zenithml | b2e68d31f9649d5477f8321b4394822f6f3a8e0c | [
"MIT"
] | 1 | 2022-03-07T16:29:32.000Z | 2022-03-07T16:29:32.000Z | zenithml/__init__.py | zenith-ml/zenithml | b2e68d31f9649d5477f8321b4394822f6f3a8e0c | [
"MIT"
] | null | null | null | __version__ = "0.0.1"
import importlib.util
from zenithml import data
from zenithml import utils
from zenithml import metrics
from zenithml import nvt
from zenithml import preprocess as pp
from zenithml.config_manager import ConfigManager
from zenithml.ray import runner as ray_runner
if importlib.util.find_spec("torc... | 26.823529 | 56 | 0.798246 | __version__ = "0.0.1"
import importlib.util
from zenithml import data
from zenithml import utils
from zenithml import metrics
from zenithml import nvt
from zenithml import preprocess as pp
from zenithml.config_manager import ConfigManager
from zenithml.ray import runner as ray_runner
if importlib.util.find_spec("torc... | true | true |
f769e6597b23ce3752aeef6a509e1edabab582d2 | 221 | py | Python | demo/demo/doctype/control_mechanism/test_control_mechanism.py | SunilBGovind/frappe_demo_dev | df86f151c8ff43db7c0a6c7981e9247893bdc309 | [
"MIT"
] | null | null | null | demo/demo/doctype/control_mechanism/test_control_mechanism.py | SunilBGovind/frappe_demo_dev | df86f151c8ff43db7c0a6c7981e9247893bdc309 | [
"MIT"
] | null | null | null | demo/demo/doctype/control_mechanism/test_control_mechanism.py | SunilBGovind/frappe_demo_dev | df86f151c8ff43db7c0a6c7981e9247893bdc309 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Sunil Govind and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestControlMechanism(unittest.TestCase):
pass
| 20.090909 | 51 | 0.769231 | from __future__ import unicode_literals
import unittest
class TestControlMechanism(unittest.TestCase):
pass
| true | true |
f769e73a2b5f9ea37892ab2eba5f7a120ce2ce63 | 1,826 | py | Python | tests/st/control/test_tensor_in_list.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/control/test_tensor_in_list.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/control/test_tensor_in_list.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 30.949153 | 101 | 0.658817 | import pytest
from mindspore import nn, Tensor, context
from mindspore import dtype as mstype
def setup_module():
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
class Net(nn.Cell):
def __init__(self):
super(Net, self).__init__()
self.list = [Tensor([1], mstype.int32), T... | true | true |
f769e780c1dec6ce326bc8d74de41df96aa9f8a9 | 3,136 | py | Python | src/lib/ir.py | xbe/qcc | 90a35057c7fea37187a0cf253eb65613702c51e3 | [
"Apache-2.0"
] | null | null | null | src/lib/ir.py | xbe/qcc | 90a35057c7fea37187a0cf253eb65613702c51e3 | [
"Apache-2.0"
] | null | null | null | src/lib/ir.py | xbe/qcc | 90a35057c7fea37187a0cf253eb65613702c51e3 | [
"Apache-2.0"
] | null | null | null | # python3
# pylint: disable=invalid-name
"""Compiler IR."""
import enum
from src.lib import helper
class Op(enum.Enum):
UNK = 0
SINGLE = 1
CTL = 2
SECTION = 3
END_SECTION = 4
class Node:
"""Single node in the IR."""
def __init__(self, opcode, name, idx0, idx1, gate, val):
self._opcode = opcode
... | 21.189189 | 77 | 0.610013 |
import enum
from src.lib import helper
class Op(enum.Enum):
UNK = 0
SINGLE = 1
CTL = 2
SECTION = 3
END_SECTION = 4
class Node:
def __init__(self, opcode, name, idx0, idx1, gate, val):
self._opcode = opcode
self._name = name
self._idx0 = idx0
self._idx1 = idx1
self._gate = gate
... | true | true |
f769e7f107cd1ced5fb64eebb6945f1a20c65394 | 1,131 | py | Python | code/src/system/controller/python/messaging/parser.py | mcelhennyi/NXP-HoverGames-2 | 7826d153b870ff46952e7b2d3b6822960fed9c23 | [
"BSD-3-Clause"
] | 1 | 2020-08-30T16:25:53.000Z | 2020-08-30T16:25:53.000Z | code/src/system/controller/python/messaging/parser.py | mcelhennyi/NXP-HoverGames-2 | 7826d153b870ff46952e7b2d3b6822960fed9c23 | [
"BSD-3-Clause"
] | 1 | 2021-02-02T00:36:07.000Z | 2021-02-02T00:36:07.000Z | code/src/system/controller/python/messaging/parser.py | mcelhennyi/NXP-HoverGames-2 | 7826d153b870ff46952e7b2d3b6822960fed9c23 | [
"BSD-3-Clause"
] | null | null | null | import struct
from src.system.controller.python.messaging.messages import *
from src.system.controller.python.messaging.messages.hello import HelloMessage
from src.system.controller.python.messaging.messages.ack import AckMessage
from src.system.controller.python.messaging.messages.welcome import WelcomeMessage
from s... | 37.7 | 113 | 0.741821 | import struct
from src.system.controller.python.messaging.messages import *
from src.system.controller.python.messaging.messages.hello import HelloMessage
from src.system.controller.python.messaging.messages.ack import AckMessage
from src.system.controller.python.messaging.messages.welcome import WelcomeMessage
from s... | true | true |
f769e88eef5eff9dfb0c191a3e5b3c0229595c91 | 3,491 | py | Python | bindings/python/ensmallen/datasets/string/tolypocladiumparadoxum.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/tolypocladiumparadoxum.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/tolypocladiumparadoxum.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Tolypocladium paradoxum.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protei... | 33.247619 | 223 | 0.679461 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def TolypocladiumParadoxum(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/str... | true | true |
f769e8c039703593f68f5fc03a43446f991cf6a2 | 1,174 | py | Python | setup.py | thomaspingel/lcpy | 6bf2893010d1dad5ad783d7c4f0351166425a1a7 | [
"MIT"
] | null | null | null | setup.py | thomaspingel/lcpy | 6bf2893010d1dad5ad783d7c4f0351166425a1a7 | [
"MIT"
] | null | null | null | setup.py | thomaspingel/lcpy | 6bf2893010d1dad5ad783d7c4f0351166425a1a7 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='lcp',
version='0.0.1',
packages=['lcp',],
license='MIT',
long_description='Collection of tools for Least Cost Path Analysis in Python.',
url='https://doi.org/10.1559/152304010791232163',
author='Thomas Pingel',
author_email='thom... | 40.482759 | 85 | 0.579216 | from setuptools import setup, find_packages
setup(
name='lcp',
version='0.0.1',
packages=['lcp',],
license='MIT',
long_description='Collection of tools for Least Cost Path Analysis in Python.',
url='https://doi.org/10.1559/152304010791232163',
author='Thomas Pingel',
author_email='thom... | true | true |
f769e8d4f730930ffa3d2147ce81e0520d4bd9b7 | 13,739 | py | Python | src/model.py | TayaV60/SimpleHTR | 5c9e3488e7a581c3f953270802d8a25d6c5493b9 | [
"MIT"
] | null | null | null | src/model.py | TayaV60/SimpleHTR | 5c9e3488e7a581c3f953270802d8a25d6c5493b9 | [
"MIT"
] | null | null | null | src/model.py | TayaV60/SimpleHTR | 5c9e3488e7a581c3f953270802d8a25d6c5493b9 | [
"MIT"
] | null | null | null | import os
import sys
from typing import List, Tuple
import numpy as np
import tensorflow as tf
from dataloader_iam import Batch
# Disable eager mode
tf.compat.v1.disable_eager_execution()
class DecoderType:
"""CTC decoder types."""
BestPath = 0
BeamSearch = 1
WordBeamSearch = 2
class Model:
"... | 42.800623 | 117 | 0.597569 | import os
import sys
from typing import List, Tuple
import numpy as np
import tensorflow as tf
from dataloader_iam import Batch
tf.compat.v1.disable_eager_execution()
class DecoderType:
BestPath = 0
BeamSearch = 1
WordBeamSearch = 2
class Model:
def __init__(self,
char_list: Lis... | true | true |
f769ea74205e1cb0fc535aed8a9ab3e7743af864 | 8,093 | py | Python | src/radical/pilot/worker/update.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | src/radical/pilot/worker/update.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | src/radical/pilot/worker/update.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null |
__copyright__ = "Copyright 2016, http://radical.rutgers.edu"
__license__ = "MIT"
import time
import pymongo
import radical.utils as ru
from .. import utils as rpu
from .. import constants as rpc
# ------------------------------------------------------------------------------
#
DEFAULT_BULK_COLLECTION_T... | 33.032653 | 83 | 0.496726 |
__copyright__ = "Copyright 2016, http://radical.rutgers.edu"
__license__ = "MIT"
import time
import pymongo
import radical.utils as ru
from .. import utils as rpu
from .. import constants as rpc
DEFAULT_BULK_COLLECTION_TIME = 1.0 DEFAULT_BULK_COLLECTION_SIZE = 100
class Update(rpu.Worker):
... | true | true |
f769ec7a6d7c17f6a3e03088ff129111af717997 | 4,456 | py | Python | benchmark/startQiskit_noisy3210.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy3210.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy3210.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=47
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 ... | 35.365079 | 140 | 0.656643 | 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
impo... | true | true |
f769ed288604d3a7e00eef6361e241054626384d | 2,523 | py | Python | gala/dynamics/tests/test_actionangle_staeckel.py | zilishen/gala | f7184e6b09fbc42a349f6b5a2bca6242f1e9936e | [
"MIT"
] | 1 | 2020-11-20T18:27:25.000Z | 2020-11-20T18:27:25.000Z | gala/dynamics/tests/test_actionangle_staeckel.py | zilishen/gala | f7184e6b09fbc42a349f6b5a2bca6242f1e9936e | [
"MIT"
] | 3 | 2021-07-26T15:07:25.000Z | 2021-09-13T15:04:27.000Z | gala/dynamics/tests/test_actionangle_staeckel.py | nstarman/gala | 5415c817a7cc5e1a5086217332466ffc7af16ab3 | [
"MIT"
] | null | null | null | # Third-party
from astropy.constants import G
import astropy.units as u
import numpy as np
import pytest
# gala
from gala.dynamics import get_staeckel_fudge_delta, PhaseSpacePosition
import gala.potential as gp
from gala.units import galactic
from .helpers import HAS_GALPY
@pytest.mark.skipif(not HAS_GALPY,
... | 37.656716 | 80 | 0.614744 | from astropy.constants import G
import astropy.units as u
import numpy as np
import pytest
from gala.dynamics import get_staeckel_fudge_delta, PhaseSpacePosition
import gala.potential as gp
from gala.units import galactic
from .helpers import HAS_GALPY
@pytest.mark.skipif(not HAS_GALPY,
reason="r... | true | true |
f769ed32498561f67a077a370d6dff1a80d01fa0 | 2,310 | py | Python | touchstone/environments/__init__.py | LechuzaAI/touchstone | 6893b199f14f34986b475c79b4a41934fcf8e7a5 | [
"MIT"
] | null | null | null | touchstone/environments/__init__.py | LechuzaAI/touchstone | 6893b199f14f34986b475c79b4a41934fcf8e7a5 | [
"MIT"
] | null | null | null | touchstone/environments/__init__.py | LechuzaAI/touchstone | 6893b199f14f34986b475c79b4a41934fcf8e7a5 | [
"MIT"
] | null | null | null | from typing import Union
from copy import deepcopy
import gym
# flake8: noqa F401
from touchstone.environments.base_vec_env import AlreadySteppingError, NotSteppingError, VecEnv, VecEnvWrapper, \
CloudpickleWrapper
from touchstone.environments.dummy_vec_env import DummyVecEnv
from touchstone.environments.subproc_... | 39.827586 | 113 | 0.760173 | from typing import Union
from copy import deepcopy
import gym
from touchstone.environments.base_vec_env import AlreadySteppingError, NotSteppingError, VecEnv, VecEnvWrapper, \
CloudpickleWrapper
from touchstone.environments.dummy_vec_env import DummyVecEnv
from touchstone.environments.subproc_vec_env import Subpr... | true | true |
f769ed4a80ecd230bac6e5c6c039e82ade3b761a | 723 | py | Python | apps/post/urls.py | jamesj0918/sejongapi-v1 | 5945b959f7d4a97ec64ee40a28a797b30067421b | [
"MIT"
] | null | null | null | apps/post/urls.py | jamesj0918/sejongapi-v1 | 5945b959f7d4a97ec64ee40a28a797b30067421b | [
"MIT"
] | 2 | 2020-02-11T23:35:52.000Z | 2020-06-05T19:55:32.000Z | apps/post/urls.py | jamesj0918/sejongapi-v1 | 5945b959f7d4a97ec64ee40a28a797b30067421b | [
"MIT"
] | null | null | null | from django.urls import path
from .views import ArticleListCreateAPIView, ArticleRetrieveUpdateDeleteCommentCreateAPIView, \
CommentUpdateDeleteAPIView, CommentListAPIView, ArticleUpvoteAPIView, ArticleDownvoteAPIView
urlpatterns = [
path('<str:channel_slug>/posts/', ArticleListCreateAPIView.as_view()),
p... | 51.642857 | 96 | 0.781466 | from django.urls import path
from .views import ArticleListCreateAPIView, ArticleRetrieveUpdateDeleteCommentCreateAPIView, \
CommentUpdateDeleteAPIView, CommentListAPIView, ArticleUpvoteAPIView, ArticleDownvoteAPIView
urlpatterns = [
path('<str:channel_slug>/posts/', ArticleListCreateAPIView.as_view()),
p... | true | true |
f769ede2eef6d08f312490fbeaeec977f2a3fd4b | 34,071 | py | Python | security_monkey/manage.py | boladmin/security_monkey | c28592ffd518fa399527d26262683fc860c30eef | [
"Apache-2.0"
] | 4,258 | 2015-01-04T22:06:10.000Z | 2022-03-31T23:40:27.000Z | security_monkey/manage.py | boladmin/security_monkey | c28592ffd518fa399527d26262683fc860c30eef | [
"Apache-2.0"
] | 1,013 | 2015-01-12T02:31:03.000Z | 2021-09-16T19:09:03.000Z | security_monkey/manage.py | boladmin/security_monkey | c28592ffd518fa399527d26262683fc860c30eef | [
"Apache-2.0"
] | 965 | 2015-01-11T21:06:07.000Z | 2022-03-17T16:53:57.000Z | # Copyright 2014 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 38.110738 | 191 | 0.641044 | from datetime import datetime
import json
import sys
from flask_script import Manager, Command, Option, prompt_pass
from six import text_type
from security_monkey.account_manager import bulk_disable_accounts, bulk_enable_accounts
from security_monkey.common.s3_canonical import get_canonical_ids
from security_monkey.... | true | true |
f769ee30e4a0138a40fb5d07757ca3ef48f4e205 | 132 | py | Python | new_venv/Lib/site-packages/cardio/core/__init__.py | Shlyankin/cardio | 9b5d954c21cda85cf8d96dc88bd097cdec27725e | [
"Apache-2.0"
] | 250 | 2017-11-22T14:41:57.000Z | 2022-02-02T22:41:28.000Z | cardio/core/__init__.py | phucynwa/cardio | 67f8794381458424ad7b4d1b7832fb0f6937d008 | [
"Apache-2.0"
] | 34 | 2017-11-23T18:27:20.000Z | 2020-09-10T11:55:16.000Z | cardio/core/__init__.py | phucynwa/cardio | 67f8794381458424ad7b4d1b7832fb0f6937d008 | [
"Apache-2.0"
] | 85 | 2017-11-23T13:07:31.000Z | 2021-11-24T08:34:07.000Z | """ Core CardIO objects """
from .ecg_batch import EcgBatch, add_actions
from .ecg_dataset import EcgDataset
from . import kernels
| 22 | 44 | 0.780303 |
from .ecg_batch import EcgBatch, add_actions
from .ecg_dataset import EcgDataset
from . import kernels
| true | true |
f769eead75aa568efd188f1fa0e9941bef0068fa | 513 | py | Python | learn-python/variable/nesting/dictionary_nest.py | Moazzam125/learn-python | a0a92a5f4d1a031d0f66a7d10682c1844b1da80d | [
"MIT"
] | 2 | 2020-12-25T06:42:13.000Z | 2020-12-25T10:25:55.000Z | learn-python/variable/nesting/dictionary_nest.py | Moazzam125/learn-python | a0a92a5f4d1a031d0f66a7d10682c1844b1da80d | [
"MIT"
] | null | null | null | learn-python/variable/nesting/dictionary_nest.py | Moazzam125/learn-python | a0a92a5f4d1a031d0f66a7d10682c1844b1da80d | [
"MIT"
] | 2 | 2021-12-27T06:15:40.000Z | 2022-01-05T15:08:29.000Z | ''' Dictionary Nesting '''
# Dictionary in string
dict_str = {
'sector': 'dictionary in string',
'variable': 'dictionary',
}
str_nest = dict_str
print(str_nest)
# Dictionary in list
dict_list = {
'sector': 'dictionary in list',
'variable': 'dictionary',
}
list_nest = [dict_list]
print(list_nest)
# ... | 16.03125 | 41 | 0.654971 |
dict_str = {
'sector': 'dictionary in string',
'variable': 'dictionary',
}
str_nest = dict_str
print(str_nest)
dict_list = {
'sector': 'dictionary in list',
'variable': 'dictionary',
}
list_nest = [dict_list]
print(list_nest)
dict0 = {
'sector': 'Dictionary in Dictionary',
}
dict1 = {
'var... | true | true |
f769eee989e4b017c93253504a3905d50b1eb131 | 1,372 | py | Python | adjutant/api/urls.py | CCI-MOC/adjutant | 032db3124ea0b0632afdfc27afc60b6c66cf5f66 | [
"Apache-2.0"
] | null | null | null | adjutant/api/urls.py | CCI-MOC/adjutant | 032db3124ea0b0632afdfc27afc60b6c66cf5f66 | [
"Apache-2.0"
] | null | null | null | adjutant/api/urls.py | CCI-MOC/adjutant | 032db3124ea0b0632afdfc27afc60b6c66cf5f66 | [
"Apache-2.0"
] | 1 | 2019-04-18T12:21:59.000Z | 2019-04-18T12:21:59.000Z | # Copyright (C) 2015 Catalyst IT Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.105263 | 78 | 0.739796 |
from django.apps import apps
from django.conf.urls import url, include
from django.conf import settings
from rest_framework_swagger.views import get_swagger_view
from adjutant.api import views
from adjutant.api.v1 import views as views_v1
urlpatterns = [
url(r'^$', views.VersionView.as_view()),
]
if apps.is_in... | true | true |
f769efa5d4b3b302ae36190433c9fb061ce44239 | 2,932 | py | Python | SMPyBandits/Experiment/Seznec19a_Fig2/main.py | choltz95/SMPyBandits | 04bc2b2bf10f8043afa5cac6589c191745735d9c | [
"MIT"
] | 1 | 2020-03-13T21:51:00.000Z | 2020-03-13T21:51:00.000Z | SMPyBandits/Experiment/Seznec19a_Fig2/main.py | choltz95/SMPyBandits | 04bc2b2bf10f8043afa5cac6589c191745735d9c | [
"MIT"
] | null | null | null | SMPyBandits/Experiment/Seznec19a_Fig2/main.py | choltz95/SMPyBandits | 04bc2b2bf10f8043afa5cac6589c191745735d9c | [
"MIT"
] | null | null | null | """
author : Julien SEZNEC
Produce the experiment and record the relevant data to reproduce Figure 2 of [Seznec et al., 2019a]
Reference: [Seznec et al., 2019a]
Rotting bandits are not harder than stochastic ones;
Julien Seznec, Andrea Locatelli, Alexandra Carpentier, Alessandro Lazaric, Michal Valko ;
Proceedings of... | 37.589744 | 145 | 0.708731 |
from SMPyBandits.Arms import RestedRottingGaussian
from SMPyBandits.Policies import FEWA, EFF_FEWA, wSWA, GreedyOracle, SWUCB, DiscountedUCB as DUCB
from SMPyBandits.Environment.MAB_rotting import repetedRuns
import numpy as np
import datetime
import os
import logging
import sys
date = datetime.datetime.now().strftim... | true | true |
f769efb92a1251a84f4e3b47d527b01d5daafb6d | 800 | py | Python | djangoVue/djangoVue/urls.py | joeypy/DjangoVue-practice | da530775a897e9cf6af0bac860f4582658caaa95 | [
"MIT"
] | null | null | null | djangoVue/djangoVue/urls.py | joeypy/DjangoVue-practice | da530775a897e9cf6af0bac860f4582658caaa95 | [
"MIT"
] | 9 | 2021-03-30T14:04:27.000Z | 2022-02-27T07:25:28.000Z | djangoVue/djangoVue/urls.py | joeypy/DjangoVue-practice | da530775a897e9cf6af0bac860f4582658caaa95 | [
"MIT"
] | null | null | null | """djangoVue URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 34.782609 | 77 | 0.7025 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('book.urls')),
]
| true | true |
f769f0615bf6fb38e118a3e7ebf3d04ccf223159 | 5,046 | py | Python | python_modules/libraries/dagster-postgres/dagster_postgres/utils.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-postgres/dagster_postgres/utils.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-postgres/dagster_postgres/utils.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | import logging
import time
from contextlib import contextmanager
from urllib.parse import quote_plus as urlquote
import psycopg2
import psycopg2.errorcodes
import sqlalchemy
from dagster import Field, IntSource, Selector, StringSource, check
from dagster.core.storage.sql import get_alembic_config, handle_schema_errors... | 31.5375 | 100 | 0.656163 | import logging
import time
from contextlib import contextmanager
from urllib.parse import quote_plus as urlquote
import psycopg2
import psycopg2.errorcodes
import sqlalchemy
from dagster import Field, IntSource, Selector, StringSource, check
from dagster.core.storage.sql import get_alembic_config, handle_schema_errors... | true | true |
f769f19656ec90d31973d8832943b442a801df9a | 401 | py | Python | learnforfree/wsgi.py | Levy-Naibei/LearnForFree | 736fdb22c8023a8220d90f7706476c8a20f979ba | [
"MIT"
] | null | null | null | learnforfree/wsgi.py | Levy-Naibei/LearnForFree | 736fdb22c8023a8220d90f7706476c8a20f979ba | [
"MIT"
] | 8 | 2020-10-15T07:40:40.000Z | 2021-01-26T02:41:27.000Z | learnforfree/wsgi.py | Levy-Naibei/LearnForFree | 736fdb22c8023a8220d90f7706476c8a20f979ba | [
"MIT"
] | 3 | 2020-10-15T14:52:36.000Z | 2021-01-25T03:59:06.000Z | """
WSGI config for learnforfree project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'learnforfree.settings')
application = get_wsgi_application()
| true | true |
f769f1fc342c602cd29ed3494b8742652c267017 | 402 | py | Python | actions/tests/build/test.py | ggml1/hodor | 79deb540bd5c362a86838021c38c9073987aeefe | [
"MIT"
] | null | null | null | actions/tests/build/test.py | ggml1/hodor | 79deb540bd5c362a86838021c38c9073987aeefe | [
"MIT"
] | 12 | 2019-11-26T22:48:40.000Z | 2019-12-09T06:05:10.000Z | actions/tests/build/test.py | ggml1/hodor | 79deb540bd5c362a86838021c38c9073987aeefe | [
"MIT"
] | 1 | 2019-11-27T04:52:34.000Z | 2019-11-27T04:52:34.000Z | import requests
import sys
def main():
url = str(sys.argv[1])
response = requests.get(url)
if (response.status_code == 200):
response = response.json()
test_result = response['msg']
if (test_result != "True"):
raise Exception(F'Integration tests failed.')
else:
raise Exception(F'GET fai... | 19.142857 | 59 | 0.651741 | import requests
import sys
def main():
url = str(sys.argv[1])
response = requests.get(url)
if (response.status_code == 200):
response = response.json()
test_result = response['msg']
if (test_result != "True"):
raise Exception(F'Integration tests failed.')
else:
raise Exception(F'GET fai... | true | true |
f769f3439e361499d21ed4060445ded3f27e4911 | 945 | py | Python | app/models/reviews.py | nikhilmenon2/Learn2Cook | 8276c8d42e1476f32916952b105fa434d4c9abcc | [
"PostgreSQL",
"Unlicense",
"MIT"
] | 11 | 2021-02-26T19:11:31.000Z | 2021-03-24T19:23:05.000Z | app/models/reviews.py | nikhilmenon2/Learn2Cook | 8276c8d42e1476f32916952b105fa434d4c9abcc | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | app/models/reviews.py | nikhilmenon2/Learn2Cook | 8276c8d42e1476f32916952b105fa434d4c9abcc | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | from .db import db
class Review(db.Model):
__tablename__ = 'reviews'
id = db.Column(db.Integer, primary_key=True)
overall = db.Column(db.Integer, nullable=False)
review = db.Column(db.String(2500), nullable=False, default="")
recipeId = db.Column(db.Integer, db.ForeignKey("recipes.id"), nullable=... | 33.75 | 81 | 0.586243 | from .db import db
class Review(db.Model):
__tablename__ = 'reviews'
id = db.Column(db.Integer, primary_key=True)
overall = db.Column(db.Integer, nullable=False)
review = db.Column(db.String(2500), nullable=False, default="")
recipeId = db.Column(db.Integer, db.ForeignKey("recipes.id"), nullable=... | true | true |
f769f45a2f46f64a9eda8925d21c7b6218e1e3c8 | 2,240 | py | Python | backend/schedule_worker/utils/przystanki.py | evemorgen/GdzieJestMojTramwajProject | 65a090ae4222053a2a0a1b145df5196f3658065c | [
"MIT"
] | null | null | null | backend/schedule_worker/utils/przystanki.py | evemorgen/GdzieJestMojTramwajProject | 65a090ae4222053a2a0a1b145df5196f3658065c | [
"MIT"
] | null | null | null | backend/schedule_worker/utils/przystanki.py | evemorgen/GdzieJestMojTramwajProject | 65a090ae4222053a2a0a1b145df5196f3658065c | [
"MIT"
] | null | null | null | import logging
import os
import json
import networkx as nx
from utils import Singleton
class Przystanki(metaclass=Singleton):
def __init__(self, path=None):
if path is None:
self.path = os.environ['TRAM_ROOT'] + "/data/przystanki_0_159.json"
else:
self.path = path
... | 34.461538 | 108 | 0.578571 | import logging
import os
import json
import networkx as nx
from utils import Singleton
class Przystanki(metaclass=Singleton):
def __init__(self, path=None):
if path is None:
self.path = os.environ['TRAM_ROOT'] + "/data/przystanki_0_159.json"
else:
self.path = path
... | true | true |
f769f4718d9f3245029ba611b274970fe1daf5b6 | 131,593 | py | Python | gpMgmt/test/behave/mgmt_utils/steps/mgmt_utils.py | sinwaj/gpdb | c03061cf4daf12bc07df9eb13d92a83b702091ab | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/test/behave/mgmt_utils/steps/mgmt_utils.py | sinwaj/gpdb | c03061cf4daf12bc07df9eb13d92a83b702091ab | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/test/behave/mgmt_utils/steps/mgmt_utils.py | sinwaj/gpdb | c03061cf4daf12bc07df9eb13d92a83b702091ab | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | import math
import fnmatch
import glob
import json
import os
import re
import pipes
import platform
import shutil
import socket
import tempfile
import _thread
import time
from subprocess import check_output, Popen, PIPE
import subprocess
from collections import defaultdict
import psutil
from behave import given, when,... | 43.315668 | 219 | 0.679291 | import math
import fnmatch
import glob
import json
import os
import re
import pipes
import platform
import shutil
import socket
import tempfile
import _thread
import time
from subprocess import check_output, Popen, PIPE
import subprocess
from collections import defaultdict
import psutil
from behave import given, when,... | true | true |
f769f5a542a28714ebc09ccc3bb9283d8de21c39 | 1,783 | py | Python | Python/Courese/Linear Regression/Logistic Regression.py | linghtiin/test | 4718dfbe33768fa6e623e27933199cbb21d440ae | [
"Apache-2.0"
] | null | null | null | Python/Courese/Linear Regression/Logistic Regression.py | linghtiin/test | 4718dfbe33768fa6e623e27933199cbb21d440ae | [
"Apache-2.0"
] | null | null | null | Python/Courese/Linear Regression/Logistic Regression.py | linghtiin/test | 4718dfbe33768fa6e623e27933199cbb21d440ae | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 02:43:27 2019
@author: z
"""
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
h = 1
sd = 1
n = 50
n_n = 1000
def gen... | 26.220588 | 90 | 0.597308 |
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
h = 1
sd = 1
n = 50
n_n = 1000
def gen_data(n, h, sd1, sd2):
x1 = ss.norm.rvs(-h, sd1, n)
y1 = ss.norm.rvs(0, sd1,... | true | true |
f769f5b2120f2ed738a5c302bcc47ced89a69497 | 446 | py | Python | leuvenmapmatching/__init__.py | jks-liu/LeuvenMapMatching | e0a85e633c0351704b3e216d167625c7a1cc65a3 | [
"Apache-2.0"
] | null | null | null | leuvenmapmatching/__init__.py | jks-liu/LeuvenMapMatching | e0a85e633c0351704b3e216d167625c7a1cc65a3 | [
"Apache-2.0"
] | null | null | null | leuvenmapmatching/__init__.py | jks-liu/LeuvenMapMatching | e0a85e633c0351704b3e216d167625c7a1cc65a3 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
leuvenmapmatching
~~~~~~~~~~~~~~~~~
:author: Wannes Meert
:copyright: Copyright 2015-2018 DTAI, KU Leuven and Sirris.
:license: Apache License, Version 2.0, see LICENSE for details.
"""
import logging
from . import map, matcher, util
# visualization is not loaded by default (avoid loading unneces... | 24.777778 | 101 | 0.730942 | import logging
from . import map, matcher, util
logger = logging.getLogger("be.kuleuven.cs.dtai.mapmatching")
__version__ = '1.1.1'
| true | true |
f769f5c88fb35eccd23b6c241f502ad1775664e7 | 4,442 | py | Python | todo/data_access.py | waynew/todo-flask | 3cb3c7b50e4c1b6370d63e21b23dca0ec56e9313 | [
"BSD-2-Clause"
] | null | null | null | todo/data_access.py | waynew/todo-flask | 3cb3c7b50e4c1b6370d63e21b23dca0ec56e9313 | [
"BSD-2-Clause"
] | null | null | null | todo/data_access.py | waynew/todo-flask | 3cb3c7b50e4c1b6370d63e21b23dca0ec56e9313 | [
"BSD-2-Clause"
] | null | null | null | import sqlite3
CONNSTR = 'todo.db'
def init_db():
'''Initialize the database by creating all necessary tables.'''
with sqlite3.connect(CONNSTR) as conn:
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE
todo_item
(desc... | 28.658065 | 76 | 0.420982 | import sqlite3
CONNSTR = 'todo.db'
def init_db():
with sqlite3.connect(CONNSTR) as conn:
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE
todo_item
(description text,
completed bool
... | true | true |
f769f5ea2304d022153299828312fff59cc79153 | 1,955 | py | Python | msgparse/server.py | vengefuldrx/hipchat-msgparse | fedcc736cac3adee6c615a0aeb922a175d4f5ec6 | [
"Apache-2.0"
] | null | null | null | msgparse/server.py | vengefuldrx/hipchat-msgparse | fedcc736cac3adee6c615a0aeb922a175d4f5ec6 | [
"Apache-2.0"
] | null | null | null | msgparse/server.py | vengefuldrx/hipchat-msgparse | fedcc736cac3adee6c615a0aeb922a175d4f5ec6 | [
"Apache-2.0"
] | null | null | null | """
asyncio socket server for handling messages
"""
import os
import asyncio
import logging
from .parser import parse_message
__all__ = ('runserver', )
LOG = logging.getLogger(__name__)
class MessageProtocol(asyncio.Protocol):
"""
Takes the recv'd bytes and parses it with the
message handler. In real c... | 24.135802 | 91 | 0.614834 | import os
import asyncio
import logging
from .parser import parse_message
__all__ = ('runserver', )
LOG = logging.getLogger(__name__)
class MessageProtocol(asyncio.Protocol):
def __init__(self, ctx, max_size, max_urls):
self.ctx = ctx
self.max_size = max_size
self.max_urls = max_urls
... | true | true |
f769f65acba22b7ed86f2d8976eb1b3258f6ecde | 3,986 | py | Python | src/main/python/pybuilder/extern/__init__.py | Mattlk13/pybuilder | 9e40eb2749f03dc354fe139ccc262a025662da5f | [
"Apache-2.0"
] | 1,419 | 2015-01-02T20:51:04.000Z | 2022-03-23T21:26:00.000Z | src/main/python/pybuilder/extern/__init__.py | Mattlk13/pybuilder | 9e40eb2749f03dc354fe139ccc262a025662da5f | [
"Apache-2.0"
] | 670 | 2015-01-01T10:26:03.000Z | 2022-02-23T16:33:13.000Z | src/main/python/pybuilder/extern/__init__.py | paolodedios/pybuilder | 12ea2f54e04f97daada375dc3309a3f525f1b5e1 | [
"Apache-2.0"
] | 270 | 2015-01-02T05:01:53.000Z | 2022-01-20T10:22:59.000Z | # -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | 34.068376 | 94 | 0.612895 |
import sys
from importlib import import_module
from importlib.abc import Loader
import pybuilder._vendor
class VendorImporter(Loader):
def __init__(self, root_name, vendored_names, vendor_pkg):
self.root_name = root_name
self.vendored_names = set(vendored_names)
self.vendor_pkg = vendor... | true | true |
f769f679a720598de8333aa6ea117ab39ca18e08 | 806 | py | Python | homewk/manage.py | jaxsbin/jaxsbin | df470cedecf5fc5728672015f228f6be48c2edf3 | [
"Apache-2.0"
] | 1 | 2021-04-04T20:24:28.000Z | 2021-04-04T20:24:28.000Z | homewk/manage.py | jaxsbin/jaxsbin | df470cedecf5fc5728672015f228f6be48c2edf3 | [
"Apache-2.0"
] | null | null | null | homewk/manage.py | jaxsbin/jaxsbin | df470cedecf5fc5728672015f228f6be48c2edf3 | [
"Apache-2.0"
] | 1 | 2017-10-13T00:53:37.000Z | 2017-10-13T00:53:37.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "homework.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... | 35.043478 | 77 | 0.64268 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "homework.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportError:
... | true | true |
f769f8f1a9d12106fd0291e9a5a6b9bc646e223b | 116,388 | py | Python | salt/state.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/state.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | salt/state.py | skrobul/salt | ef7fb71082cce7a9783e00b9c65062fefae09263 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The module used to execute states in salt. A state is unlike a module
execution in that instead of just executing a command it ensure that a
certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state fun... | 42.154292 | 132 | 0.417921 | '''
The module used to execute states in salt. A state is unlike a module
execution in that instead of just executing a command it ensure that a
certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state function name>',
'nam... | false | true |
f769f8fe50521c4a0ecafc67612f40754f0129f6 | 9,924 | py | Python | starthinker/util/sheets/__init__.py | hernanperalta/starthinker | 89d50bc56e1d2b05003c644aa07fdf697c6e9fad | [
"Apache-2.0"
] | null | null | null | starthinker/util/sheets/__init__.py | hernanperalta/starthinker | 89d50bc56e1d2b05003c644aa07fdf697c6e9fad | [
"Apache-2.0"
] | null | null | null | starthinker/util/sheets/__init__.py | hernanperalta/starthinker | 89d50bc56e1d2b05003c644aa07fdf697c6e9fad | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/... | 33.870307 | 154 | 0.6842 |
import re
from googleapiclient.errors import HttpError
from starthinker.util.project import project
from starthinker.util.auth import get_service
from starthinker.util.google_api import API_Retry
from starthinker.util.drive import file_find, file_delete
def sheets_id(auth, url_or_name):
if url_or_name.startsw... | true | true |
f769f929849f6994908fa8a9ca653f7ebe8e0e87 | 2,770 | py | Python | plugins/qdb.py | x89/raziel-irc-bot | 122a5de858a84e018549e0a7fd0be11bb33f2eb3 | [
"MIT"
] | null | null | null | plugins/qdb.py | x89/raziel-irc-bot | 122a5de858a84e018549e0a7fd0be11bb33f2eb3 | [
"MIT"
] | null | null | null | plugins/qdb.py | x89/raziel-irc-bot | 122a5de858a84e018549e0a7fd0be11bb33f2eb3 | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
import json
import requests
import requests.exceptions
import botologist.plugin
BASE_URL = 'https://qdb.lutro.me'
def _get_quote_url(quote):
return BASE_URL + '/' + str(quote['id'])
def _get_qdb_data(url, query_params):
response = requests.get(url, query_params, ... | 23.277311 | 83 | 0.636462 | import logging
log = logging.getLogger(__name__)
import json
import requests
import requests.exceptions
import botologist.plugin
BASE_URL = 'https://qdb.lutro.me'
def _get_quote_url(quote):
return BASE_URL + '/' + str(quote['id'])
def _get_qdb_data(url, query_params):
response = requests.get(url, query_params, ... | true | true |
f769f983b320440b51f1ca1146f1aab994927d7b | 8,363 | py | Python | translate_sdk/model/next_builder/storyboard_node_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | translate_sdk/model/next_builder/storyboard_node_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | translate_sdk/model/next_builder/storyboard_node_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: storyboard_node.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.prot... | 52.93038 | 983 | 0.774961 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
f769f993ce044abee39aa2c6b04648f7efeea946 | 20,273 | py | Python | python/ray/tests/test_advanced_3.py | mxz96102/ray | 02768ad707f615a47a4a5f28ae333c25012baaa1 | [
"Apache-2.0"
] | 1 | 2020-08-04T08:00:51.000Z | 2020-08-04T08:00:51.000Z | python/ray/tests/test_advanced_3.py | mxz96102/ray | 02768ad707f615a47a4a5f28ae333c25012baaa1 | [
"Apache-2.0"
] | 7 | 2020-11-13T19:06:33.000Z | 2022-02-10T02:20:25.000Z | python/ray/tests/test_advanced_3.py | mxz96102/ray | 02768ad707f615a47a4a5f28ae333c25012baaa1 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import glob
import logging
import os
import json
import sys
import socket
import time
import numpy as np
import pickle
import pytest
import ray
import ray.ray_constants as ray_constants
import ray.cluster_utils
import ray.test_utils
from ray import resource_spec
import setproctitle
from ray.test_util... | 29.127874 | 79 | 0.650076 | import glob
import logging
import os
import json
import sys
import socket
import time
import numpy as np
import pickle
import pytest
import ray
import ray.ray_constants as ray_constants
import ray.cluster_utils
import ray.test_utils
from ray import resource_spec
import setproctitle
from ray.test_utils import (check_... | true | true |
f769fac9c94165c7ae3d928edef20c6ee7483b2d | 270 | py | Python | src/scraper/__init__.py | seangreathouse/inventory-hunter | faaaa08a7d22eb837576d62755585fcea65a72da | [
"MIT"
] | null | null | null | src/scraper/__init__.py | seangreathouse/inventory-hunter | faaaa08a7d22eb837576d62755585fcea65a72da | [
"MIT"
] | null | null | null | src/scraper/__init__.py | seangreathouse/inventory-hunter | faaaa08a7d22eb837576d62755585fcea65a72da | [
"MIT"
] | null | null | null | import scraper.amazon
import scraper.bestbuy
import scraper.bhphotovideo
import scraper.microcenter
import scraper.newegg
from scraper.common import ScraperFactory
def init_scrapers(driver, urls: list):
return [ScraperFactory.create(driver, url) for url in urls]
| 22.5 | 63 | 0.818519 | import scraper.amazon
import scraper.bestbuy
import scraper.bhphotovideo
import scraper.microcenter
import scraper.newegg
from scraper.common import ScraperFactory
def init_scrapers(driver, urls: list):
return [ScraperFactory.create(driver, url) for url in urls]
| true | true |
f769fafd2baf5ac652adcee8663407c7204573ff | 1,351 | py | Python | patronclient/v2/contrib/server_external_events.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patronclient/v2/contrib/server_external_events.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patronclient/v2/contrib/server_external_events.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 30.704545 | 79 | 0.671355 |
from patronclient import base
class Event(base.Resource):
def __repr__(self):
return "<Event: %s>" % self.name
class ServerExternalEventManager(base.Manager):
resource_class = Event
def create(self, events):
body = {'events': events}
return self._create('/os-server-external-e... | true | true |
f769fb2d02cf8287ae285682458c504b75632ee2 | 26,076 | py | Python | nilearn/tests/test_signal.py | majdabd/nilearn | 55e3f26dbd9fc6e89516e5f37e8aae23ec6086a9 | [
"BSD-2-Clause"
] | null | null | null | nilearn/tests/test_signal.py | majdabd/nilearn | 55e3f26dbd9fc6e89516e5f37e8aae23ec6086a9 | [
"BSD-2-Clause"
] | null | null | null | nilearn/tests/test_signal.py | majdabd/nilearn | 55e3f26dbd9fc6e89516e5f37e8aae23ec6086a9 | [
"BSD-2-Clause"
] | null | null | null | """
Test the signals module
"""
# Author: Gael Varoquaux, Alexandre Abraham
# License: simplified BSD
import os.path
import warnings
from distutils.version import LooseVersion
import numpy as np
import pytest
# Use nisignal here to avoid name collisions (using nilearn.signal is
# not possible)
from nilearn import si... | 39.75 | 83 | 0.62268 |
import os.path
import warnings
from distutils.version import LooseVersion
import numpy as np
import pytest
from nilearn import signal as nisignal
from nilearn.signal import clean
from pandas import read_csv
import scipy.signal
def generate_signals(n_features=17, n_confounds=5, length=41,
same_... | true | true |
f769fb2e71211581d22e2262eddf052ec4f6f2ba | 3,076 | py | Python | var/spack/repos/builtin/packages/hpgmg/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/hpgmg/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/hpgmg/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Hpgmg(MakefilePackage):
"""HPGMG implements full multigrid (FMG) algorithms using ... | 36.188235 | 102 | 0.642718 |
from spack.package import *
class Hpgmg(MakefilePackage):
homepage = "https://bitbucket.org/hpgmg/hpgmg"
url = "https://hpgmg.org/static/hpgmg-0.4.tar.gz"
git = "https://bitbucket.org/hpgmg/hpgmg.git"
tags = ['proxy-app']
version('develop', branch='master')
version('0.4', ... | true | true |
f769fb6f895f4ec1119a13eb2181bcdb55656e66 | 1,978 | py | Python | neurograph/utils/python/pika_utils.py | sleep3r/pyneurograph | 9e0f891eb17bac0ec8149840aa363899800c21e5 | [
"MIT"
] | null | null | null | neurograph/utils/python/pika_utils.py | sleep3r/pyneurograph | 9e0f891eb17bac0ec8149840aa363899800c21e5 | [
"MIT"
] | 1 | 2021-08-25T14:57:14.000Z | 2021-08-25T14:57:14.000Z | neurograph/utils/python/pika_utils.py | sleep3r/pyneurograph | 9e0f891eb17bac0ec8149840aa363899800c21e5 | [
"MIT"
] | null | null | null | DIRECT = 'direct'
FANOUT = 'fanout'
TOPIC = 'topic'
HEADERS = 'headers'
class Blocking:
@staticmethod
def queue(queue_name, callback=None, exchange_name=None, routing_key=None, exchange_type=DIRECT, host='localhost',
port=None, prefetch_count=0, durable=False):
import pika
from p... | 43 | 118 | 0.68453 | DIRECT = 'direct'
FANOUT = 'fanout'
TOPIC = 'topic'
HEADERS = 'headers'
class Blocking:
@staticmethod
def queue(queue_name, callback=None, exchange_name=None, routing_key=None, exchange_type=DIRECT, host='localhost',
port=None, prefetch_count=0, durable=False):
import pika
from p... | true | true |
f769fcb3f05725f9f8a40c993b7b7282775cd908 | 22,135 | py | Python | pkgs/xlsxwriter-0.8.4-py27_0/lib/python2.7/site-packages/xlsxwriter/packager.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/xlsxwriter-0.8.4-py27_0/lib/python2.7/site-packages/xlsxwriter/packager.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | pkgs/xlsxwriter-0.8.4-py27_0/lib/python2.7/site-packages/xlsxwriter/packager.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | ###############################################################################
#
# Packager - A class for writing the Excel XLSX Worksheet file.
#
# Copyright 2013-2016, John McNamara, jmcnamara@cpan.org
#
# Standard packages.
import os
import sys
import tempfile
from shutil import copy
from .compatibility import St... | 34.748823 | 79 | 0.561057 |
import os
import sys
import tempfile
from shutil import copy
from .compatibility import StringIO
from .compatibility import BytesIO
from xlsxwriter.app import App
from xlsxwriter.contenttypes import ContentTypes
from xlsxwriter.core import Core
from xlsxwriter.relationships import Relationships
from xlsxwriter.share... | true | true |
f769fcdc167582a39232e6632de899de8ed2aeea | 337 | py | Python | reviewboard/webapi/admin.py | seekingalpha/reviewboard | 191bf21347f4272fad6ce6366d2e110025c62fd1 | [
"MIT"
] | 921 | 2015-01-01T15:26:28.000Z | 2022-03-29T11:30:38.000Z | reviewboard/webapi/admin.py | seekingalpha/reviewboard | 191bf21347f4272fad6ce6366d2e110025c62fd1 | [
"MIT"
] | 5 | 2015-03-17T18:57:47.000Z | 2020-10-02T13:24:31.000Z | reviewboard/webapi/admin.py | seekingalpha/reviewboard | 191bf21347f4272fad6ce6366d2e110025c62fd1 | [
"MIT"
] | 285 | 2015-01-12T06:24:36.000Z | 2022-03-29T11:03:50.000Z | from __future__ import unicode_literals
from reviewboard.admin import ModelAdmin, admin_site
from reviewboard.webapi.models import WebAPIToken
class WebAPITokenAdmin(ModelAdmin):
list_display = ('user', 'local_site', 'time_added', 'last_updated')
raw_id_fields = ('user',)
admin_site.register(WebAPIToken, W... | 25.923077 | 71 | 0.792285 | from __future__ import unicode_literals
from reviewboard.admin import ModelAdmin, admin_site
from reviewboard.webapi.models import WebAPIToken
class WebAPITokenAdmin(ModelAdmin):
list_display = ('user', 'local_site', 'time_added', 'last_updated')
raw_id_fields = ('user',)
admin_site.register(WebAPIToken, W... | true | true |
f769fdb095e2e88a0c8e0c2de2ba56c822b650fb | 10,026 | py | Python | graffiti_monkey/cli.py | craigbarrau/graffiti-monkey | 1233dba795b62766c0bbe3f42ea1cf16c152725b | [
"Apache-2.0"
] | null | null | null | graffiti_monkey/cli.py | craigbarrau/graffiti-monkey | 1233dba795b62766c0bbe3f42ea1cf16c152725b | [
"Apache-2.0"
] | null | null | null | graffiti_monkey/cli.py | craigbarrau/graffiti-monkey | 1233dba795b62766c0bbe3f42ea1cf16c152725b | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Answers for AWS LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 39.944223 | 208 | 0.588769 |
import argparse
import logging
import sys
from graffiti_monkey.core import GraffitiMonkey, Logging
from graffiti_monkey import __version__
from graffiti_monkey.exceptions import GraffitiMonkeyException
from boto.utils import get_instance_metadata
__all__ = ('run', )
log = logging.getLogger(__name__)
class Graffi... | true | true |
f769fe56bbe6f1172a3a33a185d9f5c9c89010da | 6,146 | py | Python | dnoise.py | Nickwasused/DNoiSe | 40cb7129ee4a9a5d74cb0f673144d5302bf8ef27 | [
"MIT"
] | 2 | 2021-06-02T09:49:23.000Z | 2021-09-10T14:05:06.000Z | dnoise.py | Nickwasused/DNoiSe | 40cb7129ee4a9a5d74cb0f673144d5302bf8ef27 | [
"MIT"
] | null | null | null | dnoise.py | Nickwasused/DNoiSe | 40cb7129ee4a9a5d74cb0f673144d5302bf8ef27 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random
import sqlite3
import sys
import time
import urllib
from importlib import reload
import dns.resolver
import pandas
import requests
reload(sys)
##############################################################################... | 36.583333 | 176 | 0.635373 |
import datetime
import json
import os
import random
import sqlite3
import sys
import time
import urllib
from importlib import reload
import dns.resolver
import pandas
import requests
reload(sys)
auth = ""
multiplier = 1.5
client = "127.0.0.1"
dns.resolver.nameservers = "127.0.0.1"
log_file = sys.stdout
workin... | true | true |
f769ff4fd51006e141adf5db6d464c25dec8af0b | 1,469 | py | Python | jupyterlab-snippets/loader.py | drykovanov/jupyterlab-snippets | 286145d76cc30e5099cab7b1710d26da0171685f | [
"BSD-3-Clause"
] | null | null | null | jupyterlab-snippets/loader.py | drykovanov/jupyterlab-snippets | 286145d76cc30e5099cab7b1710d26da0171685f | [
"BSD-3-Clause"
] | null | null | null | jupyterlab-snippets/loader.py | drykovanov/jupyterlab-snippets | 286145d76cc30e5099cab7b1710d26da0171685f | [
"BSD-3-Clause"
] | null | null | null | import os
from pathlib import PurePath
from jupyter_core.paths import jupyter_path
import tornado
class SnippetsLoader:
def __init__(self):
self.snippet_paths = jupyter_path("snippets")
def collect_snippets(self):
snippets = []
for root_path in self.snippet_paths:
for d... | 32.644444 | 89 | 0.603812 | import os
from pathlib import PurePath
from jupyter_core.paths import jupyter_path
import tornado
class SnippetsLoader:
def __init__(self):
self.snippet_paths = jupyter_path("snippets")
def collect_snippets(self):
snippets = []
for root_path in self.snippet_paths:
for d... | true | true |
f76a013223ebb80f487418514412563ff948de8a | 2,270 | py | Python | bak/ndb.py | ptarau/pypro | 9e542ed7d70454f75ce531c918a912aa85a4cd6e | [
"Apache-2.0"
] | 10 | 2019-12-23T05:03:57.000Z | 2022-03-15T15:23:58.000Z | bak/ndb.py | ptarau/pypro | 9e542ed7d70454f75ce531c918a912aa85a4cd6e | [
"Apache-2.0"
] | 1 | 2021-04-27T14:49:49.000Z | 2021-07-23T19:32:16.000Z | bak/ndb.py | ptarau/pypro | 9e542ed7d70454f75ce531c918a912aa85a4cd6e | [
"Apache-2.0"
] | 1 | 2021-09-02T11:36:13.000Z | 2021-09-02T11:36:13.000Z | from .db import *
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
#from answerer import tsv2mat
import numpy as np
from sklearn.preprocessing import OneHotEncoder
# it might work better for larger databases
def_learner=MLPClassifier(
hidden_layer_sizes=(16,16),
... | 24.945055 | 78 | 0.66696 | from .db import *
from sklearn.ensemble import RandomForestClassifier
from sklearn.neural_network import MLPClassifier
import numpy as np
from sklearn.preprocessing import OneHotEncoder
def_learner=MLPClassifier(
hidden_layer_sizes=(16,16),
verbose=1,
activation='relu',
max_iter=10000
)
def set2bits(n,xs)... | true | true |
f76a01b20bd2e36fe08a87b61f9d1a2fd1969ed7 | 127 | py | Python | cvat/apps/log_proxy/urls.py | syonekura/cvat | c579ba2319f967f09ab2bf080e357b2bde7180dd | [
"MIT"
] | 1 | 2022-01-18T16:08:34.000Z | 2022-01-18T16:08:34.000Z | cvat/apps/log_proxy/urls.py | syonekura/cvat | c579ba2319f967f09ab2bf080e357b2bde7180dd | [
"MIT"
] | null | null | null | cvat/apps/log_proxy/urls.py | syonekura/cvat | c579ba2319f967f09ab2bf080e357b2bde7180dd | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('exception/<int:jid>', views.exception_receiver),
]
| 18.142857 | 58 | 0.724409 | from django.urls import path
from . import views
urlpatterns = [
path('exception/<int:jid>', views.exception_receiver),
]
| true | true |
f76a05ac1ee3931a8fe304c4fbb14a5d804545e5 | 1,713 | py | Python | app/songs/__init__.py | jg-725/IS219-FlaskAppProject | 316aa298eda1bcda766ed085bb6f26ca7da7dfee | [
"BSD-3-Clause"
] | null | null | null | app/songs/__init__.py | jg-725/IS219-FlaskAppProject | 316aa298eda1bcda766ed085bb6f26ca7da7dfee | [
"BSD-3-Clause"
] | null | null | null | app/songs/__init__.py | jg-725/IS219-FlaskAppProject | 316aa298eda1bcda766ed085bb6f26ca7da7dfee | [
"BSD-3-Clause"
] | null | null | null | import csv
import logging
import os
from flask import Blueprint, render_template, abort, url_for,current_app
from flask_login import current_user, login_required
from jinja2 import TemplateNotFound
from app.db import db
from app.db.models import Song
from app.songs.forms import csv_upload
from werkzeug.utils import s... | 31.722222 | 83 | 0.680093 | import csv
import logging
import os
from flask import Blueprint, render_template, abort, url_for,current_app
from flask_login import current_user, login_required
from jinja2 import TemplateNotFound
from app.db import db
from app.db.models import Song
from app.songs.forms import csv_upload
from werkzeug.utils import s... | true | true |
f76a05c2ce0d9c9fb127a3678f76623a63018038 | 9,665 | py | Python | tests/components/sensor/test_min_max.py | kdschlosser/home-assistant | a94a24f6f83508642e220fadf2799789dc32a25b | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | tests/components/sensor/test_min_max.py | kdschlosser/home-assistant | a94a24f6f83508642e220fadf2799789dc32a25b | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | tests/components/sensor/test_min_max.py | kdschlosser/home-assistant | a94a24f6f83508642e220fadf2799789dc32a25b | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """The test for the min/max sensor platform."""
import unittest
from homeassistant.setup import setup_component
from homeassistant.const import (
STATE_UNKNOWN, STATE_UNAVAILABLE, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS,
TEMP_FAHRENHEIT)
from tests.common import get_test_home_assistant
class TestMinMaxSensor(... | 32.87415 | 77 | 0.5373 | import unittest
from homeassistant.setup import setup_component
from homeassistant.const import (
STATE_UNKNOWN, STATE_UNAVAILABLE, ATTR_UNIT_OF_MEASUREMENT, TEMP_CELSIUS,
TEMP_FAHRENHEIT)
from tests.common import get_test_home_assistant
class TestMinMaxSensor(unittest.TestCase):
def setup_method(self, ... | true | true |
f76a05c9c50d44843a16d5fc80a43cd5b38b47e5 | 1,085 | py | Python | Django_Assignment/mysite/urls.py | Aarif1430/Django_files_management_application | a4ba33044836a12ee68d1fef13fc7399c7592ebe | [
"MIT"
] | 1 | 2021-01-13T21:17:34.000Z | 2021-01-13T21:17:34.000Z | Django_Assignment/mysite/urls.py | Aarif1430/Django_files_management_application | a4ba33044836a12ee68d1fef13fc7399c7592ebe | [
"MIT"
] | 15 | 2021-04-08T21:18:27.000Z | 2022-03-12T00:16:25.000Z | Django_Assignment/mysite/urls.py | Aarif1430/Django_files_management_application | a4ba33044836a12ee68d1fef13fc7399c7592ebe | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic.base import TemplateView
from mysite.core import views
urlpatterns = [
path('', TemplateView.as_view(template_name='home.html'), name='home'... | 37.413793 | 90 | 0.714286 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from django.views.generic.base import TemplateView
from mysite.core import views
urlpatterns = [
path('', TemplateView.as_view(template_name='home.html'), name='home'... | true | true |
f76a070b2f1e885d21dabf9c5c8386d68a4e0820 | 3,847 | py | Python | tensorflow_hub/module_v2.py | tsadr/hub | 5186d911de9bce0adee28993fa396e7392fb1c18 | [
"Apache-2.0"
] | 1 | 2019-12-02T23:42:11.000Z | 2019-12-02T23:42:11.000Z | tensorflow_hub/module_v2.py | AllenWDYing/hub | 20f388cfe01635a2073723c5c4ffd6dd7a87fbb2 | [
"Apache-2.0"
] | null | null | null | tensorflow_hub/module_v2.py | AllenWDYing/hub | 20f388cfe01635a2073723c5c4ffd6dd7a87fbb2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Hub 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 app... | 39.255102 | 80 | 0.719522 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow_hub import native_module
from tensorflow_hub import registry
from tensorflow_hub import tf_v1
def resolve(handle):
return registry.resolver(handle)
def load(handl... | true | true |
f76a073b67882b78791d4b7f09c7b635d4a54c5b | 2,463 | py | Python | docs/source/conf.py | HBrendy/ORION_HandBook | c6ed8deb58630d12a90fce580cbafc7d7de2a778 | [
"CC-BY-4.0"
] | null | null | null | docs/source/conf.py | HBrendy/ORION_HandBook | c6ed8deb58630d12a90fce580cbafc7d7de2a778 | [
"CC-BY-4.0"
] | 32 | 2019-01-31T18:56:26.000Z | 2021-08-04T10:00:18.000Z | docs/source/conf.py | HBrendy/ORION_HandBook | c6ed8deb58630d12a90fce580cbafc7d7de2a778 | [
"CC-BY-4.0"
] | 17 | 2019-02-22T12:09:20.000Z | 2021-08-04T09:52:34.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 29.674699 | 97 | 0.671539 |
project = 'OH SFS Handbook'
copyright = 'ORION and BeONE OHEJP'
author = 'ORION and BeONE OHEJP'
release = 'v0.0.1'
extensions = [
]
templates_path = ['_templates']
exclude_patterns = []
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
from recommonmark.parser import CommonMarkParser
sour... | true | true |
f76a07acb417b8eec73c73932d812e00d944aaad | 1,995 | py | Python | tests/example_tests/shape_learning.py | sahithyaravi1493/modAL | 39336f21cd872974cf2f34c1c79012ca30a96819 | [
"MIT"
] | 1,460 | 2018-10-18T18:40:59.000Z | 2022-03-30T18:00:12.000Z | tests/example_tests/shape_learning.py | sahithyaravi1493/modAL | 39336f21cd872974cf2f34c1c79012ca30a96819 | [
"MIT"
] | 124 | 2018-10-31T06:48:18.000Z | 2022-03-25T06:09:25.000Z | tests/example_tests/shape_learning.py | sahithyaravi1493/modAL | 39336f21cd872974cf2f34c1c79012ca30a96819 | [
"MIT"
] | 236 | 2018-10-19T01:16:21.000Z | 2022-03-05T02:05:31.000Z | """
Learning the shape of an object using uncertainty based sampling.
In this example, we will demonstrate the use of ActiveLearner with
the scikit-learn implementation of the kNN classifier algorithm.
"""
import numpy as np
from copy import deepcopy
from sklearn.ensemble import RandomForestClassifier
from modAL.mode... | 34.396552 | 97 | 0.758897 |
import numpy as np
from copy import deepcopy
from sklearn.ensemble import RandomForestClassifier
from modAL.models import ActiveLearner
np.random.seed(0)
im_width = 500
im_height = 500
data = np.zeros((im_height, im_width))
data[100:im_width-1 - 100, 100:im_height-1 - 100] = 1
X_full = np.transpose(
[np.tile(np... | true | true |
f76a07b949b57f5b65cd580a23d7a5cb007a8e31 | 141 | py | Python | batman/functions/data/__init__.py | tupui/batman | 559e1c4574865694e47f52bb202c560fc6252d2d | [
"BSD-3-Clause"
] | null | null | null | batman/functions/data/__init__.py | tupui/batman | 559e1c4574865694e47f52bb202c560fc6252d2d | [
"BSD-3-Clause"
] | null | null | null | batman/functions/data/__init__.py | tupui/batman | 559e1c4574865694e47f52bb202c560fc6252d2d | [
"BSD-3-Clause"
] | null | null | null | """
Data module
***********
"""
from .data import (el_nino, tahiti, mascaret, marthe)
__all__ = ['el_nino', 'tahiti', 'mascaret', 'marthe']
| 17.625 | 53 | 0.602837 | from .data import (el_nino, tahiti, mascaret, marthe)
__all__ = ['el_nino', 'tahiti', 'mascaret', 'marthe']
| true | true |
f76a07fdb0dedcf997f75c661986255b0247ac1a | 11,197 | py | Python | tests/parsers/test_notebook_parsers.py | s-weigand/flake8-nb | 39c6cf6158cc231c420ff783a550b09ee5f7e4c7 | [
"Apache-2.0"
] | 23 | 2019-12-05T06:02:43.000Z | 2022-03-11T18:17:19.000Z | tests/parsers/test_notebook_parsers.py | s-weigand/flake8-nb | 39c6cf6158cc231c420ff783a550b09ee5f7e4c7 | [
"Apache-2.0"
] | 191 | 2019-10-04T06:22:14.000Z | 2022-03-29T04:02:28.000Z | tests/parsers/test_notebook_parsers.py | s-weigand/flake8-nb | 39c6cf6158cc231c420ff783a550b09ee5f7e4c7 | [
"Apache-2.0"
] | 6 | 2020-06-13T13:35:15.000Z | 2021-11-28T19:50:12.000Z | import os
import warnings
from typing import Dict
from typing import List
from typing import Tuple
from typing import Union
import pytest
from flake8_nb.parsers import CellId
from flake8_nb.parsers.notebook_parsers import InputLineMapping
from flake8_nb.parsers.notebook_parsers import InvalidNotebookWarning
from flak... | 37.199336 | 97 | 0.652228 | import os
import warnings
from typing import Dict
from typing import List
from typing import Tuple
from typing import Union
import pytest
from flake8_nb.parsers import CellId
from flake8_nb.parsers.notebook_parsers import InputLineMapping
from flake8_nb.parsers.notebook_parsers import InvalidNotebookWarning
from flak... | true | true |
f76a080807050dfe39ee97d50699850cdb746689 | 1,474 | py | Python | plotly/validators/layout/legend/_font.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/legend/_font.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/layout/legend/_font.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='font', parent_name='layout.legend', **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | 37.794872 | 71 | 0.559023 | import _plotly_utils.basevalidators
class FontValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name='font', parent_name='layout.legend', **kwargs
):
super(FontValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | true | true |
f76a08dd150830d90d570c25296082992d1dec8a | 1,092 | py | Python | section1/task3/S1_task3_optional#2.py | AgustD-2/caw-quant-training | 29d6ec616089ddc922d514eb28d38ddbc27b7a42 | [
"MIT"
] | null | null | null | section1/task3/S1_task3_optional#2.py | AgustD-2/caw-quant-training | 29d6ec616089ddc922d514eb28d38ddbc27b7a42 | [
"MIT"
] | null | null | null | section1/task3/S1_task3_optional#2.py | AgustD-2/caw-quant-training | 29d6ec616089ddc922d514eb28d38ddbc27b7a42 | [
"MIT"
] | null | null | null | from crypto_news_api import CryptoControlAPI
import pandas as pd
# Connect to the CryptoControl API
api = CryptoControlAPI("c570bf2c119d13e0cc9eb0b3d69d414d")
# Connect to a self-hosted proxy server (to improve performance) that points to cryptocontrol.io
proxyApi = CryptoControlAPI(
"c570bf2c119d13e0cc9eb0... | 33.090909 | 97 | 0.767399 | from crypto_news_api import CryptoControlAPI
import pandas as pd
api = CryptoControlAPI("c570bf2c119d13e0cc9eb0b3d69d414d")
proxyApi = CryptoControlAPI(
"c570bf2c119d13e0cc9eb0b3d69d414d", "http://cryptocontrol_proxy/api/v1/public")
print(pd.DataFrame(api.getTopNews()))
print(pd.DataFrame(api.getLatestN... | true | true |
f76a0982b3fef833353357c9dbf6df525ab1836d | 6,793 | py | Python | electrum_zcash/gui/kivy/uix/dialogs/crash_reporter.py | zebra-lucky/electrum-zcash | 2e66d47fa043d8c5ea536cd27a09dfb9e4ec314b | [
"MIT"
] | 11 | 2018-08-06T22:37:42.000Z | 2021-09-19T12:44:16.000Z | electrum_zcash/gui/kivy/uix/dialogs/crash_reporter.py | zebra-lucky/electrum-zcash | 2e66d47fa043d8c5ea536cd27a09dfb9e4ec314b | [
"MIT"
] | 9 | 2019-04-28T18:33:24.000Z | 2021-07-12T07:17:48.000Z | electrum_zcash/gui/kivy/uix/dialogs/crash_reporter.py | zebra-lucky/electrum-zcash | 2e66d47fa043d8c5ea536cd27a09dfb9e4ec314b | [
"MIT"
] | 14 | 2018-04-29T16:30:44.000Z | 2022-03-25T13:42:40.000Z | import sys
import json
from aiohttp.client_exceptions import ClientError
from kivy import base, utils
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.utils import platform
from electrum_zcash.gui... | 33.965 | 99 | 0.612542 | import sys
import json
from aiohttp.client_exceptions import ClientError
from kivy import base, utils
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.factory import Factory
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.utils import platform
from electrum_zcash.gui... | true | true |
f76a09c417a5643746752092fd5d14f7b67a0337 | 43,007 | py | Python | userbot/plugins/memes.py | aritramandal/dArK_pRiNcE | 01ff70cca9bec49ff80ea8dbf1979a41c2a924b1 | [
"MIT"
] | 8 | 2020-08-02T10:55:14.000Z | 2021-11-26T14:32:39.000Z | userbot/plugins/memes.py | aritramandal/dArK_pRiNcE | 01ff70cca9bec49ff80ea8dbf1979a41c2a924b1 | [
"MIT"
] | null | null | null | userbot/plugins/memes.py | aritramandal/dArK_pRiNcE | 01ff70cca9bec49ff80ea8dbf1979a41c2a924b1 | [
"MIT"
] | 17 | 2020-08-09T02:22:23.000Z | 2022-02-21T14:16:25.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.b (the "License");
# you may not use this file except in compliance with the License.
#
#
""" Userbot module for having some fun with people. """
import asyncio
import random
import re
import time
from use... | 34.4056 | 2,005 | 0.549957 |
import asyncio
import random
import re
import time
from userbot import ALIVE_NAME
from collections import deque
import requests
from telethon.tl.functions.users import GetFullUserRequest
from telethon.tl.types import MessageEntityMentionName
from cowpy import cow
from userbot import CMD_HELP,YOUTUBE_API_KEY
from... | true | true |
f76a0ba1316641cb2f556a6cfac8825bae4fb539 | 2,808 | py | Python | bitmap_panel.py | daakru/BLReLM | ad1001c101821356abff711c1ed4d3178a77baa7 | [
"MIT"
] | null | null | null | bitmap_panel.py | daakru/BLReLM | ad1001c101821356abff711c1ed4d3178a77baa7 | [
"MIT"
] | null | null | null | bitmap_panel.py | daakru/BLReLM | ad1001c101821356abff711c1ed4d3178a77baa7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
BitmapPanel | Adds a bitmap as the background on a wxPanel.
Version 1.0
Requires: wxPython, resource_path.py (v1.0)
@author: Kinetos#6935
"""
import wx
from helpers_pyinstaller import resource_path
# --------------------------------------------------------------------------- #
class Bi... | 33.428571 | 99 | 0.512464 | import wx
from helpers_pyinstaller import resource_path
class BitmapPanel(wx.Panel):
def __init__(self, *args, **kw):
super().__init__(*args, **kw)
image_file = resource_path('resource/images/BLReLM_wall.png')
self.bitmap = wx.Image(image_file, wx.BITMAP_TYPE_ANY).ConvertToBitm... | true | true |
f76a0c2e77ce306cd55047e5ebb89a5ac0d6df87 | 5,420 | py | Python | 1_Demo/raster.py | gregorulm/fcc_contraction_clustering_raster | e26a41c2d818eeab4a05a2ac2d10a6dddf268d70 | [
"MIT"
] | null | null | null | 1_Demo/raster.py | gregorulm/fcc_contraction_clustering_raster | e26a41c2d818eeab4a05a2ac2d10a6dddf268d70 | [
"MIT"
] | null | null | null | 1_Demo/raster.py | gregorulm/fcc_contraction_clustering_raster | e26a41c2d818eeab4a05a2ac2d10a6dddf268d70 | [
"MIT"
] | null | null | null | """
Contraction Clustering (RASTER):
Reference Implementation in Python with an Example
(c) 2016, 2017 Fraunhofer-Chalmers Centre for Industrial Mathematics
Algorithm development and implementation:
Gregor Ulm (gregor.ulm@fcc.chalmers.se)
Requirements:
. Python 3
. external libraries: numpy, pandas, matplotlib
This... | 26.31068 | 72 | 0.598893 |
import os
import random
import clustering as c
import visualizing as v
if __name__ == "__main__":
os.system('clear')
print("Select Contraction Clustering (RASTER) demo:")
print("1: Clustering using signficant tiles")
print("2: Ditto, but visualizing clusters with constituent po... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.