hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k β | max_stars_repo_stars_event_min_datetime stringlengths 24 24 β | max_stars_repo_stars_event_max_datetime stringlengths 24 24 β | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k β | max_issues_repo_issues_event_min_datetime stringlengths 24 24 β | max_issues_repo_issues_event_max_datetime stringlengths 24 24 β | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k β | max_forks_repo_forks_event_min_datetime stringlengths 24 24 β | max_forks_repo_forks_event_max_datetime stringlengths 24 24 β | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f1f9fb6b6767124d78b271f7fe5d93b4e6f8e0 | 833 | py | Python | setup.py | dominoFire/sweeper | 26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9 | [
"MIT"
] | null | null | null | setup.py | dominoFire/sweeper | 26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9 | [
"MIT"
] | null | null | null | setup.py | dominoFire/sweeper | 26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='sweeper',
version='0.1',
packages=find_packages(),
url='https://bitbucket.org/dominofire/sweeper',
license='',
author='Fernando Aguilar',
author_email='fer.aguilar.reyes@gmail.com',
description='Workflow execution on cloud environ... | 25.242424 | 94 | 0.594238 | from setuptools import setup, find_packages
setup(
name='sweeper',
version='0.1',
packages=find_packages(),
url='https://bitbucket.org/dominofire/sweeper',
license='',
author='Fernando Aguilar',
author_email='fer.aguilar.reyes@gmail.com',
description='Workflow execution on cloud environ... | true | true |
f7f1fb21a3c7ed32d6c3f7e1cef189106ee323f8 | 4,481 | py | Python | tests/test_autoslug_fields.py | EvgeneOskin/django-extensions | f40be190de1102f663573e65cbb19b4d7da83864 | [
"MIT"
] | null | null | null | tests/test_autoslug_fields.py | EvgeneOskin/django-extensions | f40be190de1102f663573e65cbb19b4d7da83864 | [
"MIT"
] | null | null | null | tests/test_autoslug_fields.py | EvgeneOskin/django-extensions | f40be190de1102f663573e65cbb19b4d7da83864 | [
"MIT"
] | 1 | 2019-03-21T08:17:36.000Z | 2019-03-21T08:17:36.000Z | # coding=utf-8
import django
import pytest
from django.db import models
from django.test import TestCase
from django_extensions.db.fields import AutoSlugField
from .testapp.models import ChildSluggedTestModel, SluggedTestModel
if django.VERSION >= (1, 7):
from django.db import migrations # NOQA
from django.... | 30.277027 | 95 | 0.587369 |
import django
import pytest
from django.db import models
from django.test import TestCase
from django_extensions.db.fields import AutoSlugField
from .testapp.models import ChildSluggedTestModel, SluggedTestModel
if django.VERSION >= (1, 7):
from django.db import migrations
from django.db.migrations.writer... | true | true |
f7f1fcc9bff8af090c92dcb4f929c375806607de | 222 | py | Python | quaddicted/forms.py | hemebond/quaddicted | c9219fe40e31c7431121d0491d92add51b99e73d | [
"MIT"
] | 8 | 2019-12-29T23:01:25.000Z | 2022-02-05T23:28:45.000Z | quaddicted/forms.py | hemebond/quaddicted | c9219fe40e31c7431121d0491d92add51b99e73d | [
"MIT"
] | 43 | 2019-12-27T16:15:36.000Z | 2021-01-04T16:47:28.000Z | quaddicted/forms.py | hemebond/quaddicted | c9219fe40e31c7431121d0491d92add51b99e73d | [
"MIT"
] | 1 | 2020-04-09T23:39:23.000Z | 2020-04-09T23:39:23.000Z | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegistrationForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'password1', 'password2')
| 22.2 | 54 | 0.774775 | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class RegistrationForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'password1', 'password2')
| true | true |
f7f1fcd53388aafdbeb5ac45baf415602630e1cd | 330 | py | Python | app/models/__init__.py | quanpower/sitp | 082f244dd35c5e881b332a624d4808f3e9e81a96 | [
"Apache-2.0"
] | null | null | null | app/models/__init__.py | quanpower/sitp | 082f244dd35c5e881b332a624d4808f3e9e81a96 | [
"Apache-2.0"
] | 4 | 2020-03-24T15:46:19.000Z | 2022-03-08T21:09:16.000Z | app/models/__init__.py | quanpower/sitp | 082f244dd35c5e881b332a624d4808f3e9e81a96 | [
"Apache-2.0"
] | null | null | null | from .user import Permission, Role, Follow, User, AnonymousUser, Post, Comment
from .daq import Project, Worker,Temperature, Power, Alarm
__all__ = [
'Permission',
'Role',
'Follow',
'User',
'AnonymousUser',
'Post',
'Comment',
'Project',
'Worker',
'Temperature',
'Power',
... | 19.411765 | 78 | 0.6 | from .user import Permission, Role, Follow, User, AnonymousUser, Post, Comment
from .daq import Project, Worker,Temperature, Power, Alarm
__all__ = [
'Permission',
'Role',
'Follow',
'User',
'AnonymousUser',
'Post',
'Comment',
'Project',
'Worker',
'Temperature',
'Power',
... | true | true |
f7f1fd37d0c9c92791abd71248379242b3e9a178 | 6,617 | py | Python | Utilities/TransferTaskModule.py | Mog333/DTQN | 656efa400c2bbde99522ea2f269505d5566e255c | [
"MIT"
] | 1 | 2020-09-25T15:13:54.000Z | 2020-09-25T15:13:54.000Z | Utilities/TransferTaskModule.py | Mog333/DTQN | 656efa400c2bbde99522ea2f269505d5566e255c | [
"MIT"
] | null | null | null | Utilities/TransferTaskModule.py | Mog333/DTQN | 656efa400c2bbde99522ea2f269505d5566e255c | [
"MIT"
] | null | null | null | import sys
from random import randrange
import random
from ale_python_interface import ALEInterface
import ALEEnvironment
'''
example rom strings
3 tasks: pong space invaders easy and space invaders hard / fast bombs
pong:(0,0)^space_invaders:(0,0)&(1,7)
pong^space_invaders
pong.bin
'''
class... | 33.251256 | 208 | 0.625963 | import sys
from random import randrange
import random
from ale_python_interface import ALEInterface
import ALEEnvironment
'''
example rom strings
3 tasks: pong space invaders easy and space invaders hard / fast bombs
pong:(0,0)^space_invaders:(0,0)&(1,7)
pong^space_invaders
pong.bin
'''
class... | false | true |
f7f1fe3bf92ed2663a55aff617df1ca655009e62 | 1,727 | py | Python | book/code/amazon - project 4 scrapt most recently comment.py | marcus-pham/test | bcbc7c34a672ae6c7e9bdc811934c4003134ae0d | [
"MIT"
] | null | null | null | book/code/amazon - project 4 scrapt most recently comment.py | marcus-pham/test | bcbc7c34a672ae6c7e9bdc811934c4003134ae0d | [
"MIT"
] | null | null | null | book/code/amazon - project 4 scrapt most recently comment.py | marcus-pham/test | bcbc7c34a672ae6c7e9bdc811934c4003134ae0d | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from selenium import webdriver
class Book():
def __init__(self):
self.title = ""
self.detail_link = ""
def get_python_book_list():
book_list = []
driver = webdriver.PhantomJS(executable_path = r'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
url = 'https://www.amazon.com/s/r... | 21.860759 | 97 | 0.702374 | from bs4 import BeautifulSoup
from selenium import webdriver
class Book():
def __init__(self):
self.title = ""
self.detail_link = ""
def get_python_book_list():
book_list = []
driver = webdriver.PhantomJS(executable_path = r'C:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
url = 'https://www.amazon.com/s/r... | false | true |
f7f1ffbb7a0d9085cf6168578ac04e2e9a5341d5 | 778 | py | Python | resources/reset_password.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | resources/reset_password.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | resources/reset_password.py | donovan-PNW/dwellinglybackend | 448df61f6ea81f00dde7dab751f8b2106f0eb7b1 | [
"MIT"
] | null | null | null | from flask_restful import Resource, reqparse
from models.user import UserModel
from resources.email import Email
class ResetPassword(Resource):
parser = reqparse.RequestParser()
parser.add_argument("email", required=True)
def post(self):
data = ResetPassword.parser.parse_args()
user = Use... | 28.814815 | 70 | 0.632391 | from flask_restful import Resource, reqparse
from models.user import UserModel
from resources.email import Email
class ResetPassword(Resource):
parser = reqparse.RequestParser()
parser.add_argument("email", required=True)
def post(self):
data = ResetPassword.parser.parse_args()
user = Use... | true | true |
f7f2011b11d811dc951960bab37aaa9b299ab490 | 1,554 | py | Python | 836 Rectangle Overlap.py | krishna13052001/LeetCode | cd6ec626bea61f0bd9e8493622074f9e69a7a1c3 | [
"MIT"
] | 872 | 2015-06-15T12:02:41.000Z | 2022-03-30T08:44:35.000Z | 836 Rectangle Overlap.py | nadeemshaikh-github/LeetCode | 3fb14aeea62a960442e47dfde9f964c7ffce32be | [
"MIT"
] | 8 | 2015-06-21T15:11:59.000Z | 2022-02-01T11:22:34.000Z | 836 Rectangle Overlap.py | nadeemshaikh-github/LeetCode | 3fb14aeea62a960442e47dfde9f964c7ffce32be | [
"MIT"
] | 328 | 2015-06-28T03:10:35.000Z | 2022-03-29T11:05:28.000Z | #!/usr/bin/python3
"""
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the
coordinates of its bottom-left corner, and (x2, y2) are the coordinates of its
top-right corner.
Two rectangles overlap if the area of their intersection is positive. To be
clear, two rectangles that only touch at the... | 27.75 | 81 | 0.57529 |
from typing import List
class Solution:
def isRectangleOverlap(self, rec1: List[int], rec2: List[int]) -> bool:
return not (
rec1[2] <= rec2[0] or
rec1[0] >= rec2[2] or
rec1[1] >= rec2[3] or
rec1[3] <= rec2[1]
)
def isRectangleOverl... | true | true |
f7f2032a9fa86012cfc6c1fb204b0e81759fd51f | 6,294 | py | Python | models/dataset.py | ggapp1/microinfl-instagram | e3fefbc09f9ee1bc5010618ccae647e4d763f503 | [
"MIT"
] | null | null | null | models/dataset.py | ggapp1/microinfl-instagram | e3fefbc09f9ee1bc5010618ccae647e4d763f503 | [
"MIT"
] | null | null | null | models/dataset.py | ggapp1/microinfl-instagram | e3fefbc09f9ee1bc5010618ccae647e4d763f503 | [
"MIT"
] | null | null | null | from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler
import numpy as np
import networkx as nx
import random
import pickle as pk
import torch
import torch.nn.functional as F
class Node:
def __init__(self, node, embedding, features, walk):
self.node = node
self.embedding = embedding
self.feature... | 35.965714 | 129 | 0.74722 | from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler
import numpy as np
import networkx as nx
import random
import pickle as pk
import torch
import torch.nn.functional as F
class Node:
def __init__(self, node, embedding, features, walk):
self.node = node
self.embedding = embedding
self.feature... | true | true |
f7f2046178de0c9ea70e0683dd71288d29192ee8 | 847 | py | Python | visualisation/visualisation.py | keyz182/LEDServer | 0dba00b7f61d30c6b21577671bf59a5702009054 | [
"MIT"
] | null | null | null | visualisation/visualisation.py | keyz182/LEDServer | 0dba00b7f61d30c6b21577671bf59a5702009054 | [
"MIT"
] | 1 | 2020-08-18T17:19:08.000Z | 2020-08-18T17:19:08.000Z | visualisation/visualisation.py | keyz182/LEDServer | 0dba00b7f61d30c6b21577671bf59a5702009054 | [
"MIT"
] | null | null | null | import threading
import logging
import neopixel
from time import sleep
logger = logging.getLogger(__name__)
class Visualisation(threading.Thread):
def __init__(self, pixels: neopixel.NeoPixel, num_pixels: int):
super().__init__()
self.pixels = pixels
self.num_pixels = num_pixels
... | 26.46875 | 69 | 0.577332 | import threading
import logging
import neopixel
from time import sleep
logger = logging.getLogger(__name__)
class Visualisation(threading.Thread):
def __init__(self, pixels: neopixel.NeoPixel, num_pixels: int):
super().__init__()
self.pixels = pixels
self.num_pixels = num_pixels
... | true | true |
f7f204b0e0b1a004083232333de6af2966843429 | 2,806 | py | Python | discordbot.py | XiaomiDiscord/miui-updates-tracker | a7b44d62c35b089182b41943828fb6edc77262ed | [
"MIT"
] | null | null | null | discordbot.py | XiaomiDiscord/miui-updates-tracker | a7b44d62c35b089182b41943828fb6edc77262ed | [
"MIT"
] | null | null | null | discordbot.py | XiaomiDiscord/miui-updates-tracker | a7b44d62c35b089182b41943828fb6edc77262ed | [
"MIT"
] | null | null | null | import discord
from os import environ
class DiscordBot(discord.Client):
def __init__(self, token):
super().__init__()
self.token = token
self.updates = None
self.channels = None
async def send_message(self, update: dict):
"""
Generates and sends a Discord messag... | 38.972222 | 167 | 0.564148 | import discord
from os import environ
class DiscordBot(discord.Client):
def __init__(self, token):
super().__init__()
self.token = token
self.updates = None
self.channels = None
async def send_message(self, update: dict):
android = update['android']
codename = u... | true | true |
f7f204d676ca44b43dfba0bcf1019be96722945f | 2,428 | py | Python | conftest.py | potolock/proverca | 3dd9720dd7733905c2441329d26d02fd1a72beea | [
"Apache-2.0"
] | null | null | null | conftest.py | potolock/proverca | 3dd9720dd7733905c2441329d26d02fd1a72beea | [
"Apache-2.0"
] | null | null | null | conftest.py | potolock/proverca | 3dd9720dd7733905c2441329d26d02fd1a72beea | [
"Apache-2.0"
] | null | null | null |
import pytest
import json
import os.path
import jsonpickle
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__... | 28.564706 | 129 | 0.695222 |
import pytest
import json
import os.path
import jsonpickle
import importlib
from fixture.application import Application
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__... | true | true |
f7f205bae9abcfb1cbf0067960fbc4ab5806a816 | 1,470 | py | Python | 3-python/introduction_to_python2/midterm/midterm.py | cccaaannn/homeworks | 2a3031faab9fe40ccb9ffb1f852d4817b38f16a7 | [
"MIT"
] | null | null | null | 3-python/introduction_to_python2/midterm/midterm.py | cccaaannn/homeworks | 2a3031faab9fe40ccb9ffb1f852d4817b38f16a7 | [
"MIT"
] | null | null | null | 3-python/introduction_to_python2/midterm/midterm.py | cccaaannn/homeworks | 2a3031faab9fe40ccb9ffb1f852d4817b38f16a7 | [
"MIT"
] | null | null | null | # 1
word = "racecar"
if(word.lower()[::-1] == word):
print("{} is a palindrome.".format(word))
else:
print("{} is not a palindrome.".format(word))
# 2
import random
d = {}
for _ in range(10):
num = random.randint(1, 50)
if(num not in d):
d.update({num:num%10})
print("Dictionary: {}".format(d)... | 23.333333 | 56 | 0.485714 |
word = "racecar"
if(word.lower()[::-1] == word):
print("{} is a palindrome.".format(word))
else:
print("{} is not a palindrome.".format(word))
import random
d = {}
for _ in range(10):
num = random.randint(1, 50)
if(num not in d):
d.update({num:num%10})
print("Dictionary: {}".format(d))
l =... | true | true |
f7f20626366eee6f2d4de9c3158ac1d5a73c173e | 412 | py | Python | src/base/tasks.py | izhukov1992/sourcechecker | 9766ec32279590b07ca77b012553e383d3db9b21 | [
"MIT"
] | null | null | null | src/base/tasks.py | izhukov1992/sourcechecker | 9766ec32279590b07ca77b012553e383d3db9b21 | [
"MIT"
] | null | null | null | src/base/tasks.py | izhukov1992/sourcechecker | 9766ec32279590b07ca77b012553e383d3db9b21 | [
"MIT"
] | null | null | null | import requests
from base.models import Resource
from djangoreactredux.celery import app
@app.task
def checkResources():
resources = Resource.objects.all()
for resource in resources:
try:
status_code = requests.get(resource.url).status_code
except:
status_code = 404
... | 21.684211 | 67 | 0.665049 | import requests
from base.models import Resource
from djangoreactredux.celery import app
@app.task
def checkResources():
resources = Resource.objects.all()
for resource in resources:
try:
status_code = requests.get(resource.url).status_code
except:
status_code = 404
... | true | true |
f7f2074f2bfe3f7c46968eb8ba8e4335386fef05 | 12,043 | py | Python | mindspore/dataset/text/utils.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 2 | 2020-11-23T13:46:37.000Z | 2020-12-20T02:02:38.000Z | mindspore/dataset/text/utils.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 1 | 2020-12-29T06:46:38.000Z | 2020-12-29T06:46:38.000Z | mindspore/dataset/text/utils.py | dongkcs/mindspore | cd7df6dbf463ff3128e9181e9d0c779cecb81320 | [
"Apache-2.0"
] | 1 | 2021-05-12T06:30:29.000Z | 2021-05-12T06:30:29.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... | 41.38488 | 120 | 0.663705 |
from enum import IntEnum
import copy
import numpy as np
import mindspore._c_dataengine as cde
from .validators import check_from_file, check_from_list, check_from_dict, check_from_dataset, \
check_from_dataset_sentencepiece, check_from_file_sentencepiece, check_save_model
__all__ = [
"Vocab", "S... | true | true |
f7f207da52df3b6596f208c0a7c509c775dd0e25 | 1,205 | py | Python | onnxmltools/convert/keras/operator_converters/common.py | Oewyn/onnxmltools | 8dbd844dab77754971f59d4d533e6763ce0b03c2 | [
"MIT"
] | 1 | 2018-04-10T02:30:47.000Z | 2018-04-10T02:30:47.000Z | onnxmltools/convert/keras/operator_converters/common.py | Oewyn/onnxmltools | 8dbd844dab77754971f59d4d533e6763ce0b03c2 | [
"MIT"
] | null | null | null | onnxmltools/convert/keras/operator_converters/common.py | Oewyn/onnxmltools | 8dbd844dab77754971f59d4d533e6763ce0b03c2 | [
"MIT"
] | 1 | 2018-06-27T18:16:20.000Z | 2018-06-27T18:16:20.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
def get_p... | 35.441176 | 81 | 0.588382 |
def get_permutation_config(n_dims):
input_perm_axes = [0, n_dims + 1] + list(range(1, n_dims + 1))
output_perm_axes = [0] + list(range(2, n_dims + 2)) + [1]
return input_perm_axes, output_perm_axes
def extract_recurrent_activation(activation):
from keras import activations
alpha = None
b... | true | true |
f7f2084549a0a7bdbb856715cebefc730390eb7b | 3,576 | py | Python | app.py | j00nas/python-flask-sudoku-solver | e14c96c3e28564d37f7aff95b8d52b68bf0dcef2 | [
"BSD-2-Clause"
] | null | null | null | app.py | j00nas/python-flask-sudoku-solver | e14c96c3e28564d37f7aff95b8d52b68bf0dcef2 | [
"BSD-2-Clause"
] | null | null | null | app.py | j00nas/python-flask-sudoku-solver | e14c96c3e28564d37f7aff95b8d52b68bf0dcef2 | [
"BSD-2-Clause"
] | null | null | null | from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def load_index():
content = ['r' + str(i) + 'c' + str(j) for i in range(9) for j in range(9)]
sudoku = []
error_message = ''
solution = ['' for i in range(81)]
some_input = False
for i in content:
if request.args.get(i) i... | 25.913043 | 131 | 0.55481 | from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def load_index():
content = ['r' + str(i) + 'c' + str(j) for i in range(9) for j in range(9)]
sudoku = []
error_message = ''
solution = ['' for i in range(81)]
some_input = False
for i in content:
if request.args.get(i) i... | true | true |
f7f2086167dda5a5c4df2bad2bbb6c2b7b0414c8 | 2,249 | py | Python | msgraph/cli/command_modules/planner/azext_planner/__init__.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/planner/azext_planner/__init__.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/planner/azext_planner/__init__.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 37.483333 | 101 | 0.647399 |
from azure.cli.core import AzCommandsLoader
from azext_planner.generated._help import helps
try:
from azext_planner.manual._help import helps
except ImportError as e:
if e.name.endswith('manual._help'):
pass
else:
raise e
class PlannerCommandsLoader(AzCommandsLoader):
de... | true | true |
f7f2092f7622a5bdb9b536ab84a0698b7fc764b1 | 6,895 | py | Python | storm_mergers.py | SarraHayoune/Summer2020 | 32cab8537231fb4ab15de401e577a90522f7eda9 | [
"MIT"
] | 1 | 2020-06-20T04:29:57.000Z | 2020-06-20T04:29:57.000Z | storm_mergers.py | SarraHayoune/Summer2020 | 32cab8537231fb4ab15de401e577a90522f7eda9 | [
"MIT"
] | null | null | null | storm_mergers.py | SarraHayoune/Summer2020 | 32cab8537231fb4ab15de401e577a90522f7eda9 | [
"MIT"
] | null | null | null | #this code is to track merger between dwarf galaxies that host supermassive black holes"
import pynbody
import numpy as np
from numpy import _NoValue
import pandas as pd
import matplotlib.pylab as plt
import readcol
import BH_functions as BHF
from decimal import Decimal
files = readcol.readcol('/media/jillian/storm/... | 37.069892 | 123 | 0.503988 |
import pynbody
import numpy as np
from numpy import _NoValue
import pandas as pd
import matplotlib.pylab as plt
import readcol
import BH_functions as BHF
from decimal import Decimal
files = readcol.readcol('/media/jillian/storm/files.list')
files = files[:,0]
# function to find black hole
def findBH(s):
#BHfi... | false | true |
f7f2096b8bd228c4001f61e3444f24d3f60f9e7a | 4,462 | py | Python | whitewater_analysis/utilities/get_data_from_aw.py | whitewater-gis/reach-processing-utilities | a23772d83286275a8f1bb6d1b8e59416e3530cfb | [
"Apache-2.0"
] | 3 | 2015-09-06T02:30:50.000Z | 2020-09-15T06:06:07.000Z | whitewater_analysis/utilities/get_data_from_aw.py | whitewater-gis/reach-processing-utilities | a23772d83286275a8f1bb6d1b8e59416e3530cfb | [
"Apache-2.0"
] | 1 | 2015-04-27T16:48:19.000Z | 2018-08-02T03:50:30.000Z | whitewater_analysis/utilities/get_data_from_aw.py | whitewater-gis/reach-processing-utilities | a23772d83286275a8f1bb6d1b8e59416e3530cfb | [
"Apache-2.0"
] | null | null | null | # import modules
import json
import arcpy
import requests
# status updates
def send_note(message):
arcpy.AddMessage(message)
# wrap up getting the loaded JSON in a single function
def get_reach_json(reach_id):
# url for amazon api REST endpoint calling lambda script
root_url = 'https://oem... | 36.57377 | 121 | 0.577992 |
import json
import arcpy
import requests
def send_note(message):
arcpy.AddMessage(message)
def get_reach_json(reach_id):
root_url = 'https://oemj2neo2b.execute-api.us-west-2.amazonaws.com/v20161116/getReachGeoJson'
response = requests.get('{0}?reachid={1}'.format(root_url, reac... | true | true |
f7f20aeafdc86b140290a7e2194e660ff5bd6fda | 3,809 | py | Python | test/dlc_tests/sanity/test_security_check.py | kevinyaoxm/deep-learning-containers | 7041cf1623e23fb1769f933d1c0e363e21d87df2 | [
"Apache-2.0"
] | 1 | 2021-06-05T14:46:17.000Z | 2021-06-05T14:46:17.000Z | test/dlc_tests/sanity/test_security_check.py | kevinyaoxm/deep-learning-containers | 7041cf1623e23fb1769f933d1c0e363e21d87df2 | [
"Apache-2.0"
] | null | null | null | test/dlc_tests/sanity/test_security_check.py | kevinyaoxm/deep-learning-containers | 7041cf1623e23fb1769f933d1c0e363e21d87df2 | [
"Apache-2.0"
] | 1 | 2021-05-29T04:30:16.000Z | 2021-05-29T04:30:16.000Z | import json
from datetime import datetime
from time import sleep, time
import pytest
from packaging.version import Version
from invoke import run
from invoke import Context
from test.test_utils import get_account_id_from_image_uri, get_region_from_image_uri, login_to_ecr_registry
from test.test_utils import ecr as... | 43.284091 | 119 | 0.719086 | import json
from datetime import datetime
from time import sleep, time
import pytest
from packaging.version import Version
from invoke import run
from invoke import Context
from test.test_utils import get_account_id_from_image_uri, get_region_from_image_uri, login_to_ecr_registry
from test.test_utils import ecr as... | true | true |
f7f20b1ce224bb4a8955ec064aec7b6b71367ec8 | 41,355 | py | Python | torch/ao/quantization/_dbr/quantization_state.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 2 | 2022-02-14T13:56:03.000Z | 2022-02-14T13:56:05.000Z | torch/ao/quantization/_dbr/quantization_state.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 1 | 2019-07-23T15:23:32.000Z | 2019-07-23T15:32:23.000Z | torch/ao/quantization/_dbr/quantization_state.py | metacpp/pytorch | 1e7a4d6bbe1fac4fb94f6b62f24c6e242db1e952 | [
"Intel"
] | 2 | 2019-07-23T14:37:31.000Z | 2019-07-23T14:47:13.000Z | from typing import Callable, List, Tuple, Any, Optional, Dict
import torch
import torch.nn.functional as F
from .mappings import (
conv_ops,
ops_are_related,
)
from .utils import (
_raise_obs_not_found_error,
_raise_obs_op_mismatch,
op_needs_quantization,
SeenQOpInfo,
SeenNonQOpInfo,
... | 41.730575 | 114 | 0.616709 | from typing import Callable, List, Tuple, Any, Optional, Dict
import torch
import torch.nn.functional as F
from .mappings import (
conv_ops,
ops_are_related,
)
from .utils import (
_raise_obs_not_found_error,
_raise_obs_op_mismatch,
op_needs_quantization,
SeenQOpInfo,
SeenNonQOpInfo,
... | true | true |
f7f20daca344d3c98c22c576f9a2d0d1d1547023 | 481 | py | Python | usefull_scripts/class_operator.py | Furzoom/learnpython | a3034584e481d4e7c55912d9da06439688aa67ea | [
"MIT"
] | null | null | null | usefull_scripts/class_operator.py | Furzoom/learnpython | a3034584e481d4e7c55912d9da06439688aa67ea | [
"MIT"
] | null | null | null | usefull_scripts/class_operator.py | Furzoom/learnpython | a3034584e481d4e7c55912d9da06439688aa67ea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class Number:
def __init__(self, start):
self.data = start
def __sub__(self, other):
return Number(self.data - other)
def __neg__(self):
return Number(- self.data)
def __str__(self):
return '[Number: {0}]'.format(self.dat... | 17.814815 | 48 | 0.544699 |
class Number:
def __init__(self, start):
self.data = start
def __sub__(self, other):
return Number(self.data - other)
def __neg__(self):
return Number(- self.data)
def __str__(self):
return '[Number: {0}]'.format(self.data)
if __name__ == '__main__':
def test(... | true | true |
f7f20e4f953b13f7142349dbfc790ec552dcc3bb | 926 | py | Python | pseudo_dojo/data/__init__.py | henriquemiranda/pseudo_dojo | 40e26ca5139909b891581a07e12f375e921f6aad | [
"CC-BY-4.0"
] | null | null | null | pseudo_dojo/data/__init__.py | henriquemiranda/pseudo_dojo | 40e26ca5139909b891581a07e12f375e921f6aad | [
"CC-BY-4.0"
] | null | null | null | pseudo_dojo/data/__init__.py | henriquemiranda/pseudo_dojo | 40e26ca5139909b891581a07e12f375e921f6aad | [
"CC-BY-4.0"
] | null | null | null | """
Functions providing access to file data for unit tests and tutorials.
Preferred way to import the module is via the import syntax:
import pseudo_dojo.data as pdj_data
"""
from __future__ import print_function, division, unicode_literals, absolute_import
import os
from pseudo_dojo.core.pseudos import dojopseudo_f... | 25.722222 | 101 | 0.737581 | from __future__ import print_function, division, unicode_literals, absolute_import
import os
from pseudo_dojo.core.pseudos import dojopseudo_from_file, DojoTable
__all__ = [
"pseudo",
"pseudos",
]
dirpath = os.path.dirname(__file__)
def pseudopath(filename):
return os.path.join(dirpath, file... | true | true |
f7f20ef120398b8bf8fd113215ff26c0bd2ba4ab | 3,048 | py | Python | backend/visualset/util.py | steinitzu/visualset | 379f00759151dba8f80d13f396f05a764aaaa3c8 | [
"MIT"
] | null | null | null | backend/visualset/util.py | steinitzu/visualset | 379f00759151dba8f80d13f396f05a764aaaa3c8 | [
"MIT"
] | null | null | null | backend/visualset/util.py | steinitzu/visualset | 379f00759151dba8f80d13f396f05a764aaaa3c8 | [
"MIT"
] | null | null | null | from bisect import bisect_left
from numpy.random import uniform
from random import sample
from collections import Counter
def chunked(seq, n):
chunk = []
for i in seq:
chunk.append(i)
if len(chunk) == n:
yield chunk
chunk = []
if chunk:
yield chunk
def clo... | 28.222222 | 83 | 0.628937 | from bisect import bisect_left
from numpy.random import uniform
from random import sample
from collections import Counter
def chunked(seq, n):
chunk = []
for i in seq:
chunk.append(i)
if len(chunk) == n:
yield chunk
chunk = []
if chunk:
yield chunk
def clo... | true | true |
f7f20fb694178dbd7d8f9ffae3d44bb7fbc82d39 | 9,216 | py | Python | trabajos/forms.py | jmjacquet/IronWeb | 974d7fca8db69ffcfec15325cdb641a1b4b2c526 | [
"MIT"
] | null | null | null | trabajos/forms.py | jmjacquet/IronWeb | 974d7fca8db69ffcfec15325cdb641a1b4b2c526 | [
"MIT"
] | 9 | 2020-09-22T12:34:00.000Z | 2021-09-10T16:32:04.000Z | trabajos/forms.py | jmjacquet/IronWeb | 974d7fca8db69ffcfec15325cdb641a1b4b2c526 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django import forms
from .models import *
from django.forms import ModelForm
import datetime
from .utilidades import *
from django.forms.widgets import TextInput,NumberInput
from django.utils.safestring import mark_safe
from crispy_forms.helper import FormHelper
from crispy_forms.layout imp... | 57.242236 | 202 | 0.740343 |
from django import forms
from .models import *
from django.forms import ModelForm
import datetime
from .utilidades import *
from django.forms.widgets import TextInput,NumberInput
from django.utils.safestring import mark_safe
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout
from crispy_... | true | true |
f7f21190df965a97e75b324daf35b8407e8641b3 | 505 | py | Python | pyquil/tests/utils.py | joshcombes/pyquil | d61b4a086c622eea21e1cfcaccacfd6a9096d5bf | [
"Apache-2.0"
] | 2 | 2019-10-06T12:54:56.000Z | 2021-01-15T06:23:28.000Z | pyquil/tests/utils.py | ball199578/pyquil | d60778ef0d0c8845fdb618613e12ac0a9e3d5410 | [
"Apache-2.0"
] | 2 | 2019-06-02T03:16:24.000Z | 2019-06-04T05:16:06.000Z | pyquil/tests/utils.py | joshcombes/pyquil | d61b4a086c622eea21e1cfcaccacfd6a9096d5bf | [
"Apache-2.0"
] | null | null | null | from pyquil.parser import parse
from pyquil.api._qac import AbstractCompiler
from pyquil import Program
def parse_equals(quil_string, *instructions):
expected = list(instructions)
actual = parse(quil_string)
assert expected == actual
class DummyCompiler(AbstractCompiler):
def get_version_info(self):... | 24.047619 | 61 | 0.740594 | from pyquil.parser import parse
from pyquil.api._qac import AbstractCompiler
from pyquil import Program
def parse_equals(quil_string, *instructions):
expected = list(instructions)
actual = parse(quil_string)
assert expected == actual
class DummyCompiler(AbstractCompiler):
def get_version_info(self):... | true | true |
f7f211dc749300402aae9fa6210af519d4b3c98e | 736 | py | Python | shiftmanager/metadata.py | mcorsen/shiftmanager | ca6a71ef5d91dc93e26a6a74a9f7a01abe217b59 | [
"BSD-2-Clause"
] | null | null | null | shiftmanager/metadata.py | mcorsen/shiftmanager | ca6a71ef5d91dc93e26a6a74a9f7a01abe217b59 | [
"BSD-2-Clause"
] | null | null | null | shiftmanager/metadata.py | mcorsen/shiftmanager | ca6a71ef5d91dc93e26a6a74a9f7a01abe217b59 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Project metadata
Information describing the project.
"""
# The package name, which is also the "UNIX name" for the project.
package = 'shiftmanager'
project = 'shiftmanager'
project_no_spaces = project.replace(' ', '')
version = '0.7.1'
description = 'Management tools for Amazon Redshift'
... | 32 | 73 | 0.672554 |
package = 'shiftmanager'
project = 'shiftmanager'
project_no_spaces = project.replace(' ', '')
version = '0.7.1'
description = 'Management tools for Amazon Redshift'
authors = ['Jeff Klukas', 'Rob Story', 'Meli Lewis',
'Allison Keene', 'Xavier Stevens', 'KF Fellows',
'Andrew Harris', 'Mikena Wo... | true | true |
f7f211dc991ae5eb45f14f060f30cd52f34fe8a8 | 956 | py | Python | scripts/generateVel.py | garg-akash/senseDetectAvoid | 73ce2f60f14697f9a944b4bd64345de2693fb028 | [
"MIT"
] | null | null | null | scripts/generateVel.py | garg-akash/senseDetectAvoid | 73ce2f60f14697f9a944b4bd64345de2693fb028 | [
"MIT"
] | null | null | null | scripts/generateVel.py | garg-akash/senseDetectAvoid | 73ce2f60f14697f9a944b4bd64345de2693fb028 | [
"MIT"
] | null | null | null | import rospy
import numpy as np
from std_msgs.msg import Float64
from std_msgs.msg import Float64MultiArray
def callback(data):
pub = rospy.Publisher('self/azimuth', Float64, queue_size=1)
vec = [data[0], data[1], data[2], data[3], data[4]]
aa = np.roots(vec)
a = 2*np.arctan(aa)
print("Theta: ",a,"... | 28.117647 | 65 | 0.593096 | import rospy
import numpy as np
from std_msgs.msg import Float64
from std_msgs.msg import Float64MultiArray
def callback(data):
pub = rospy.Publisher('self/azimuth', Float64, queue_size=1)
vec = [data[0], data[1], data[2], data[3], data[4]]
aa = np.roots(vec)
a = 2*np.arctan(aa)
print("Theta: ",a,"... | false | true |
f7f211f4a380101f8ec9578fbf40f6ddc294a965 | 594 | py | Python | src/djanban/apps/charts/templatetags/charts.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 33 | 2017-06-14T18:04:25.000Z | 2021-06-15T07:07:56.000Z | src/djanban/apps/charts/templatetags/charts.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 1 | 2017-05-10T08:45:55.000Z | 2017-05-10T08:45:55.000Z | src/djanban/apps/charts/templatetags/charts.py | diegojromerolopez/djanban | 6451688d49cf235d03c604b19a6a8480b33eed87 | [
"MIT"
] | 8 | 2017-08-27T11:14:25.000Z | 2021-03-03T12:11:16.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
import inspect
from django import template
import datetime
from django.db.models import Sum
from djanban.apps.base.auth import get_user_boards
from djanban.apps.dev_times.models import DailySpentTime
register = template.Library()
@re... | 25.826087 | 89 | 0.76431 |
from __future__ import unicode_literals
import importlib
import inspect
from django import template
import datetime
from django.db.models import Sum
from djanban.apps.base.auth import get_user_boards
from djanban.apps.dev_times.models import DailySpentTime
register = template.Library()
@register.simple_tag
def s... | true | true |
f7f212434db9d9724c309bb05b3e475c6175975f | 23,710 | py | Python | sdk/python/pulumi_aws/sagemaker/device_fleet.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/sagemaker/device_fleet.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/sagemaker/device_fleet.py | chivandikwa/pulumi-aws | 19c08bf9dcb90544450ffa4eec7bf6751058fde2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 46.490196 | 257 | 0.660607 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *
__all__ = ['DeviceFleetArgs', 'DeviceFleet']
@pulumi.input_type
class DeviceFleetArgs:
def __init__(__self__, *,
... | true | true |
f7f21294e17c77e015d4cd16c562ff4f6d72fc74 | 8,318 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_vpn_sites_configuration_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.719512 | 200 | 0.686223 |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impo... | true | true |
f7f21332f1393e856cfa28b07d18e6afd72c55ed | 2,349 | py | Python | src/vmware/azext_vmware/vendored_sdks/models/cluster.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/vmware/azext_vmware/vendored_sdks/models/cluster.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 1 | 2020-06-12T01:39:40.000Z | 2020-06-12T01:39:40.000Z | src/vmware/azext_vmware/vendored_sdks/models/cluster.py | YingXue/azure-cli-extensions | 30086b7fe22ed591daaae9019920db6c16aef9de | [
"MIT"
] | 1 | 2019-05-02T00:55:30.000Z | 2019-05-02T00:55:30.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 35.059701 | 85 | 0.572584 |
from .resource import Resource
class Cluster(Resource):
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'sku': {'required': True},
'cluster_id': {'readonly': True},
'hosts': {'readonly': True},
'provi... | true | true |
f7f2136c40e2e3316e509810e9e4fa71011a75c9 | 273 | py | Python | Preprocessing/ConvertPdf.py | IsVeneti/greek-gov-nlp | 23701314007cef377f1d5d8c4679a64df8e90bc0 | [
"Apache-2.0"
] | null | null | null | Preprocessing/ConvertPdf.py | IsVeneti/greek-gov-nlp | 23701314007cef377f1d5d8c4679a64df8e90bc0 | [
"Apache-2.0"
] | null | null | null | Preprocessing/ConvertPdf.py | IsVeneti/greek-gov-nlp | 23701314007cef377f1d5d8c4679a64df8e90bc0 | [
"Apache-2.0"
] | null | null | null | from urllib.request import urlopen
from pdfminer.high_level import extract_text
def pdf_to_text(data):
with urlopen(data) as wFile:
text = extract_text(wFile)
return text
docUrl = 'https://diavgeia.gov.gr/doc/Ξ©ΞΞ64653Ξ Ξ-2ΞΞ‘'
print(pdf_to_text(docUrl))
| 19.5 | 53 | 0.74359 | from urllib.request import urlopen
from pdfminer.high_level import extract_text
def pdf_to_text(data):
with urlopen(data) as wFile:
text = extract_text(wFile)
return text
docUrl = 'https://diavgeia.gov.gr/doc/Ξ©ΞΞ64653Ξ Ξ-2ΞΞ‘'
print(pdf_to_text(docUrl))
| true | true |
f7f213d298bbd9f73830e2486beb55a08bc393e6 | 2,186 | py | Python | skp_edu_docker/code/master/workflow/netconf/workflow_netconf_w2v.py | TensorMSA/hoyai_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 8 | 2017-06-16T00:19:12.000Z | 2020-08-13T03:15:57.000Z | kict_edu_docker/code/master/workflow/netconf/workflow_netconf_w2v.py | TensorMSA/tensormsa_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 21 | 2017-06-09T10:15:14.000Z | 2018-03-29T07:51:02.000Z | skp_edu_docker/code/master/workflow/netconf/workflow_netconf_w2v.py | TensorMSA/hoyai_docker | 12f0041e6306d8a6421585a4b51666bad30be442 | [
"MIT"
] | 4 | 2017-10-25T09:59:53.000Z | 2020-05-07T09:51:11.000Z | from master.workflow.netconf.workflow_netconf import WorkFlowNetConf
class WorkFlowNetConfW2V(WorkFlowNetConf):
"""
"""
def __init__(self, key = None):
"""
init key variable
:param key::q!
:return:
"""
self.key = key
self._set_key_parms(['window_size... | 25.717647 | 109 | 0.544373 | from master.workflow.netconf.workflow_netconf import WorkFlowNetConf
class WorkFlowNetConfW2V(WorkFlowNetConf):
def __init__(self, key = None):
self.key = key
self._set_key_parms(['window_size', 'window_size', 'vector_size', 'batch_size', 'iter', 'min_count'])
self._set_prhb_parms(['window_... | true | true |
f7f2164dcd3507aa713ca870a4ed6d4b3c725c30 | 7,095 | py | Python | python/pyspark/sql/tests/test_column.py | etspaceman/spark | 155a67d00cb2f12aad179f6df2d992feca8e003e | [
"Apache-2.0"
] | 7 | 2017-08-16T10:53:26.000Z | 2020-09-20T14:03:20.000Z | python/pyspark/sql/tests/test_column.py | etspaceman/spark | 155a67d00cb2f12aad179f6df2d992feca8e003e | [
"Apache-2.0"
] | 7 | 2020-03-04T23:44:51.000Z | 2022-02-16T01:05:52.000Z | python/pyspark/sql/tests/test_column.py | etspaceman/spark | 155a67d00cb2f12aad179f6df2d992feca8e003e | [
"Apache-2.0"
] | 4 | 2020-06-28T08:23:33.000Z | 2021-08-04T07:24:45.000Z | # -*- encoding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the ... | 44.622642 | 98 | 0.62692 |
import sys
from pyspark.sql import Column, Row
from pyspark.sql.types import *
from pyspark.sql.utils import AnalysisException
from pyspark.testing.sqlutils import ReusedSQLTestCase
class ColumnTests(ReusedSQLTestCase):
def test_column_name_encoding(self):
columns = self.spark.createDa... | true | true |
f7f2170335ceb565dbce5b87bad1f0703a42dafa | 2,022 | py | Python | python/src/nnabla/utils/cli/utility.py | syoyo/nnabla | b776b68dcdffe894cac1233dfd07c301415cc0fb | [
"Apache-2.0"
] | null | null | null | python/src/nnabla/utils/cli/utility.py | syoyo/nnabla | b776b68dcdffe894cac1233dfd07c301415cc0fb | [
"Apache-2.0"
] | null | null | null | python/src/nnabla/utils/cli/utility.py | syoyo/nnabla | b776b68dcdffe894cac1233dfd07c301415cc0fb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony Corporation. 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 applicabl... | 32.612903 | 100 | 0.624629 |
import os
import numpy as np
def is_float(x):
try:
float(x)
return True
except ValueError:
return False
def compute_full_path(root_path, file_path):
full_path = os.path.join(root_path, file_path)
full_path = full_path.replace('\\', os.path.sep)
full_pat... | true | true |
f7f21703a20d5982e962bd5305155fef3e7bb833 | 3,103 | py | Python | app/dashapp1/callbacks.py | Louie-L/medium-ml | ae227a60b9f4b084a04893bb123dbbfed4809276 | [
"MIT"
] | 2 | 2020-07-31T18:21:33.000Z | 2020-12-16T13:01:25.000Z | app/dashapp1/callbacks.py | Louie-L/medium-ml | ae227a60b9f4b084a04893bb123dbbfed4809276 | [
"MIT"
] | null | null | null | app/dashapp1/callbacks.py | Louie-L/medium-ml | ae227a60b9f4b084a04893bb123dbbfed4809276 | [
"MIT"
] | 1 | 2021-03-17T12:47:20.000Z | 2021-03-17T12:47:20.000Z | from datetime import datetime as dt
import pandas_datareader as pdr
from dash.dependencies import Input
from dash.dependencies import Output
from app.dashapp1.data.data import Data
import dash_table as dtb
import plotly.graph_objs as go
def register_callbacks(dashapp):
@dashapp.callback(Output('my-graph-2', ... | 27.954955 | 123 | 0.519497 | from datetime import datetime as dt
import pandas_datareader as pdr
from dash.dependencies import Input
from dash.dependencies import Output
from app.dashapp1.data.data import Data
import dash_table as dtb
import plotly.graph_objs as go
def register_callbacks(dashapp):
@dashapp.callback(Output('my-graph-2', ... | true | true |
f7f218ffa33b98d25b7f53d09a1087ef7bee707b | 1,806 | py | Python | tellurium/tests/test_examples.py | ShaikAsifullah/distributed-tellurium | 007e9b3842b614edd34908c001119c6da1d41897 | [
"Apache-2.0"
] | 1 | 2019-06-19T04:40:33.000Z | 2019-06-19T04:40:33.000Z | tellurium/tests/test_examples.py | ShaikAsifullah/distributed-tellurium | 007e9b3842b614edd34908c001119c6da1d41897 | [
"Apache-2.0"
] | null | null | null | tellurium/tests/test_examples.py | ShaikAsifullah/distributed-tellurium | 007e9b3842b614edd34908c001119c6da1d41897 | [
"Apache-2.0"
] | null | null | null | """
Unittests for examples.
All examples are executed to check against latest code base.
"""
from __future__ import print_function, division
import unittest
import os
import imp
from helpers import filesInDirectory
# ----------------------------------------------------------------
# List of python files to test
# ---... | 34.075472 | 95 | 0.54928 | from __future__ import print_function, division
import unittest
import os
import imp
from helpers import filesInDirectory
examples_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'examples')
notebookdir = os.path.join(examples_dir, 'notebooks-py')
tedir = os.path.join(examples_dir, 'tel... | true | true |
f7f21abf34e2b94acf6ef1792fbf404eae99d918 | 816 | py | Python | setup.py | butlermathandscienceclub/superstacks | 5d096075e2d37a2f087f0c296649769c85f2cb1e | [
"MIT"
] | null | null | null | setup.py | butlermathandscienceclub/superstacks | 5d096075e2d37a2f087f0c296649769c85f2cb1e | [
"MIT"
] | null | null | null | setup.py | butlermathandscienceclub/superstacks | 5d096075e2d37a2f087f0c296649769c85f2cb1e | [
"MIT"
] | 1 | 2022-01-04T22:16:46.000Z | 2022-01-04T22:16:46.000Z | from setuptools import setup
if __name__ == '__main__':
setup( name = 'superstacks',
packages = ['superstacks'], #
version = '0.1',
download_url = 'https://github.com/kellantech/superstacks/archive/refs/tags/v0.1.1.tar.gz',
keywords = ['stacks', 'python', ':)'], #
install_req... | 32.64 | 99 | 0.568627 | from setuptools import setup
if __name__ == '__main__':
setup( name = 'superstacks',
packages = ['superstacks'],
version = '0.1',
download_url = 'https://github.com/kellantech/superstacks/archive/refs/tags/v0.1.1.tar.gz',
keywords = ['stacks', 'python', ':)'],
install_requi... | true | true |
f7f21ac317f51c4aca7b5c641a5bb39b2dfb7817 | 3,452 | py | Python | transfer/input.py | thenomemac/transfer | c82eb32cc0db2cb278cdb079a2ff04cbf06c2bdb | [
"MIT"
] | 119 | 2018-01-15T04:41:39.000Z | 2021-01-09T07:03:20.000Z | transfer/input.py | thenomemac/transfer | c82eb32cc0db2cb278cdb079a2ff04cbf06c2bdb | [
"MIT"
] | 15 | 2018-01-19T00:57:27.000Z | 2018-12-19T14:50:10.000Z | transfer/input.py | thenomemac/transfer | c82eb32cc0db2cb278cdb079a2ff04cbf06c2bdb | [
"MIT"
] | 24 | 2018-01-17T18:30:21.000Z | 2020-06-20T13:36:54.000Z | import os
import re
from colorama import init
from termcolor import colored
def int_input(message, low, high, show_range = True):
'''
Ask a user for a int input between two values
args:
message (str): Prompt for user
low (int): Low value, user entered value must be > this value to be acce... | 29.758621 | 103 | 0.579954 | import os
import re
from colorama import init
from termcolor import colored
def int_input(message, low, high, show_range = True):
int_in = low - 1
while (int_in < low) or (int_in > high):
if show_range:
suffix = ' (integer between ' + str(low) + ' and ' + str(high) + ')'
else:
... | true | true |
f7f21b08888433a0d3be456b07f72542426fce46 | 1,107 | py | Python | tests/test_image_dir_format.py | detecttechnologies/datumaro | a00a4ec6807787d341c71f75f5e337c3cb7be119 | [
"MIT"
] | null | null | null | tests/test_image_dir_format.py | detecttechnologies/datumaro | a00a4ec6807787d341c71f75f5e337c3cb7be119 | [
"MIT"
] | null | null | null | tests/test_image_dir_format.py | detecttechnologies/datumaro | a00a4ec6807787d341c71f75f5e337c3cb7be119 | [
"MIT"
] | null | null | null | import numpy as np
from unittest import TestCase
from datumaro.components.project import Dataset
from datumaro.components.extractor import DatasetItem
from datumaro.plugins.image_dir import ImageDirConverter
from datumaro.util.test_utils import TestDir, test_save_and_load
class ImageDirFormatTest(TestCase):
def... | 35.709677 | 72 | 0.653117 | import numpy as np
from unittest import TestCase
from datumaro.components.project import Dataset
from datumaro.components.extractor import DatasetItem
from datumaro.plugins.image_dir import ImageDirConverter
from datumaro.util.test_utils import TestDir, test_save_and_load
class ImageDirFormatTest(TestCase):
def... | true | true |
f7f21bac5105eb9e3f560d3129fa7233796f82dd | 44,811 | py | Python | testing/acceptance_test.py | xoviat/pytest-xdist | 9785a316ae62ebc042caee4115c04791a1ba4e92 | [
"MIT"
] | null | null | null | testing/acceptance_test.py | xoviat/pytest-xdist | 9785a316ae62ebc042caee4115c04791a1ba4e92 | [
"MIT"
] | null | null | null | testing/acceptance_test.py | xoviat/pytest-xdist | 9785a316ae62ebc042caee4115c04791a1ba4e92 | [
"MIT"
] | null | null | null | import os
import re
import py
import pytest
import xdist
class TestDistribution:
def test_n1_pass(self, testdir):
p1 = testdir.makepyfile(
"""
def test_ok():
pass
"""
)
result = testdir.runpytest(p1, "-n1")
assert result.ret == 0
... | 31.075589 | 97 | 0.527504 | import os
import re
import py
import pytest
import xdist
class TestDistribution:
def test_n1_pass(self, testdir):
p1 = testdir.makepyfile(
"""
def test_ok():
pass
"""
)
result = testdir.runpytest(p1, "-n1")
assert result.ret == 0
... | true | true |
f7f21be1d9daa48ab52edee053a0c107cf862ecc | 2,301 | py | Python | rosetta/access.py | timgates42/django-rosetta | 7ebd8e1dc30359b40375aaa83114510429cf1306 | [
"MIT"
] | null | null | null | rosetta/access.py | timgates42/django-rosetta | 7ebd8e1dc30359b40375aaa83114510429cf1306 | [
"MIT"
] | null | null | null | rosetta/access.py | timgates42/django-rosetta | 7ebd8e1dc30359b40375aaa83114510429cf1306 | [
"MIT"
] | null | null | null | import importlib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .conf import settings as rosetta_settings
def can_translate(user):
return get_access_control_function()(user)
def get_access_control_function():
"""
Return a predicate for determining if a us... | 39 | 245 | 0.719687 | import importlib
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from .conf import settings as rosetta_settings
def can_translate(user):
return get_access_control_function()(user)
def get_access_control_function():
fn_path = getattr(settings, 'ROSETTA_ACCESS_CONTRO... | true | true |
f7f21be4a098af30ad9808b55a6480eb859ca178 | 12,531 | py | Python | src/lib/telegram/ext/dispatcher.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 17 | 2017-08-04T15:41:05.000Z | 2020-10-16T18:02:41.000Z | src/lib/telegram/ext/dispatcher.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 3 | 2017-08-04T23:37:37.000Z | 2017-08-04T23:38:34.000Z | src/lib/telegram/ext/dispatcher.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 3 | 2017-12-07T16:30:59.000Z | 2019-06-16T02:48:28.000Z | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | 33.867568 | 99 | 0.599394 |
import logging
import weakref
from functools import wraps
from threading import Thread, Lock, Event, current_thread, BoundedSemaphore
from time import sleep
from uuid import uuid4
from collections import defaultdict
from queue import Queue, Empty
from future.builtins import range
from telegram imp... | true | true |
f7f21c1b800117a5da6433eeb924b32e831b1909 | 9,132 | py | Python | data-processing/common/compile.py | alexkreidler/scholarphi | 86d26d0bfa5ded00760fba1a9c6891a94a3dd6d2 | [
"Apache-2.0"
] | null | null | null | data-processing/common/compile.py | alexkreidler/scholarphi | 86d26d0bfa5ded00760fba1a9c6891a94a3dd6d2 | [
"Apache-2.0"
] | null | null | null | data-processing/common/compile.py | alexkreidler/scholarphi | 86d26d0bfa5ded00760fba1a9c6891a94a3dd6d2 | [
"Apache-2.0"
] | null | null | null | import configparser
import logging
import os
import os.path
import re
import subprocess
from typing import Iterator, List, Optional
from common import file_utils
from common.types import CompilationResult, CompiledTexFile, OutputFile, RelativePath
COMPILE_CONFIG = "config.ini"
PDF_MESSAGE_PREFIX = b"Generated PDF: "
... | 35.533074 | 98 | 0.688568 | import configparser
import logging
import os
import os.path
import re
import subprocess
from typing import Iterator, List, Optional
from common import file_utils
from common.types import CompilationResult, CompiledTexFile, OutputFile, RelativePath
COMPILE_CONFIG = "config.ini"
PDF_MESSAGE_PREFIX = b"Generated PDF: "
... | true | true |
f7f21df5f28d8f8c9ad1b92defb133da658987a9 | 3,729 | py | Python | tests/gold_tests/body_factory/http204_response.test.py | zhaorun/trafficserver | 757256129811441f29eea288b1d7e19bc54fab9c | [
"Apache-2.0"
] | 1 | 2019-10-28T04:36:50.000Z | 2019-10-28T04:36:50.000Z | tests/gold_tests/body_factory/http204_response.test.py | zhaorun/trafficserver | 757256129811441f29eea288b1d7e19bc54fab9c | [
"Apache-2.0"
] | 3 | 2017-09-22T19:18:56.000Z | 2021-06-21T18:07:14.000Z | tests/gold_tests/body_factory/http204_response.test.py | zhaorun/trafficserver | 757256129811441f29eea288b1d7e19bc54fab9c | [
"Apache-2.0"
] | null | null | null | '''
Tests that 204 responses conform to rfc2616, unless custom templates override.
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF license... | 39.670213 | 187 | 0.743899 |
import os
Test.Summary = '''
Tests that 204 responses conform to rfc2616, unless custom templates override.
'''
ts = Test.MakeATSProcess("ts")
server = Test.MakeOriginServer("server")
DEFAULT_204_HOST = 'www.default204.test'
CUSTOM_TEMPLATE_204_HOST = 'www.customtemplate204.test'
ts.Disk.records_con... | true | true |
f7f21f6452886cf5c55ca576843a825c18de8a18 | 423 | py | Python | adv/elisanne.py | KingMikeXS/dl | c05f1c2e96aa7d13f6a5e92df05fb4e7b00bcebd | [
"Apache-2.0"
] | null | null | null | adv/elisanne.py | KingMikeXS/dl | c05f1c2e96aa7d13f6a5e92df05fb4e7b00bcebd | [
"Apache-2.0"
] | null | null | null | adv/elisanne.py | KingMikeXS/dl | c05f1c2e96aa7d13f6a5e92df05fb4e7b00bcebd | [
"Apache-2.0"
] | null | null | null | import adv.adv_test
from core.advbase import *
from slot.a import *
from slot.d import *
def module():
return Elisanne
class Elisanne(Adv):
comment = 'no s2 or s3'
a1 = ('bt',0.25)
conf = {}
conf['slots.a'] = BB() + FWHC()
conf['slots.d'] = Halloween_Maritimus()
conf['acl'] = """
... | 18.391304 | 48 | 0.572104 | import adv.adv_test
from core.advbase import *
from slot.a import *
from slot.d import *
def module():
return Elisanne
class Elisanne(Adv):
comment = 'no s2 or s3'
a1 = ('bt',0.25)
conf = {}
conf['slots.a'] = BB() + FWHC()
conf['slots.d'] = Halloween_Maritimus()
conf['acl'] = """
... | true | true |
f7f2212149bec10dc7c15ad6ad03540310de8442 | 7,609 | py | Python | homeassistant/components/verisure/sensor.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | 1 | 2021-03-20T12:25:26.000Z | 2021-03-20T12:25:26.000Z | homeassistant/components/verisure/sensor.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | 51 | 2020-08-03T07:30:44.000Z | 2022-03-22T06:02:42.000Z | homeassistant/components/verisure/sensor.py | bg1000/core | 4ee4d674d8931927eae5222e3bf8dd6e26f3c6e5 | [
"Apache-2.0"
] | null | null | null | """Support for Verisure sensors."""
from __future__ import annotations
from typing import Any, Callable, Iterable
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, TE... | 33.082609 | 85 | 0.642529 | from __future__ import annotations
from typing import Any, Callable, Iterable
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
from homeassistant.core i... | true | true |
f7f22158ea9585d31b130df3baa07865090d6951 | 8,441 | py | Python | tensorflow_federated/python/core/api/computations.py | khramtsova/federated | 88b3ca65204a9922696ccefd774ece03ebf5cc8e | [
"Apache-2.0"
] | 2 | 2019-07-09T10:04:39.000Z | 2019-10-02T05:10:16.000Z | tensorflow_federated/python/core/api/computations.py | khramtsova/federated | 88b3ca65204a9922696ccefd774ece03ebf5cc8e | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/api/computations.py | khramtsova/federated | 88b3ca65204a9922696ccefd774ece03ebf5cc8e | [
"Apache-2.0"
] | 2 | 2019-10-10T06:19:41.000Z | 2021-01-28T03:06:55.000Z | # Lint as: python3
# Copyright 2018, The TensorFlow Federated 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 ... | 37.683036 | 80 | 0.725033 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_federated.python.core.impl import computation_wrapper_instances
def tf_computation(*args):
return computation_wrapper_instances.tensorflow_wrapper(*args)
def tf2_computation... | true | true |
f7f22167ede55a72de41b0ecc6b6c6d2485f335a | 2,748 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200501/get_virtual_network_gateway_vpnclient_connection_health.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200501/get_virtual_network_gateway_vpnclient_connection_health.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200501/get_virtual_network_gateway_vpnclient_connection_health.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 41.636364 | 208 | 0.725619 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetVirtualNetworkGatewayVpnclientConnectionHealthResult',
'AwaitableGetVirtualNetworkGatewayVpnclientConnectionHealthResult',... | true | true |
f7f221804ab47fc5089c1eb68d064bf6853ea4fa | 2,418 | py | Python | test/services/test_HttpEndpoint.py | pip-services3-python/pip-services3-rpc-python | c2ec57340680df3eb079f1144f1c0cb55464477d | [
"MIT"
] | null | null | null | test/services/test_HttpEndpoint.py | pip-services3-python/pip-services3-rpc-python | c2ec57340680df3eb079f1144f1c0cb55464477d | [
"MIT"
] | null | null | null | test/services/test_HttpEndpoint.py | pip-services3-python/pip-services3-rpc-python | c2ec57340680df3eb079f1144f1c0cb55464477d | [
"MIT"
] | 4 | 2020-03-16T00:14:14.000Z | 2021-05-24T15:31:58.000Z | # -*- coding: utf-8 -*-
"""
test_DummyRestService
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dummy commandable HTTP service test
:copyright: Conceptual Vision Consulting LLC 2015-2016, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
import json
import requests
from pip_s... | 31 | 102 | 0.65426 |
import json
import requests
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.refer import References, Descriptor
from pip_services3_rpc.services import HttpEndpoint
from ..Dummy import Dummy
from ..DummyController import DummyController
from ..SubDummy import SubDummy
from ..services.... | true | true |
f7f222d919220408fa3405df325da11c9a3e60f8 | 5,966 | py | Python | eutester/testcases/images/load_hvm_image.py | nephomaniac/eutester | cc71456dd37930096cb8d0a6cac8b42fc8479543 | [
"BSD-2-Clause"
] | null | null | null | eutester/testcases/images/load_hvm_image.py | nephomaniac/eutester | cc71456dd37930096cb8d0a6cac8b42fc8479543 | [
"BSD-2-Clause"
] | null | null | null | eutester/testcases/images/load_hvm_image.py | nephomaniac/eutester | cc71456dd37930096cb8d0a6cac8b42fc8479543 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
#... | 61.505155 | 180 | 0.752598 |
from eutester.testcase_utils.eutestcase import EutesterTestCase
from imageutils import ImageUtils
machine=None
testcase = EutesterTestCase()
testcase.setup_parser(testname='load_hvm_image.py',
description='Loads an hvm image from either a remote url or local file ... | true | true |
f7f2232226c9189b30edfed037731173f0222ceb | 498 | py | Python | groups/urls.py | khabdrick/gistmedia | 3f4b87f3bb5922f4e4d6fdd69572bfced0cdf38c | [
"MIT"
] | null | null | null | groups/urls.py | khabdrick/gistmedia | 3f4b87f3bb5922f4e4d6fdd69572bfced0cdf38c | [
"MIT"
] | 4 | 2021-03-30T13:17:42.000Z | 2021-09-22T18:59:00.000Z | groups/urls.py | khabdrick/gistmedia | 3f4b87f3bb5922f4e4d6fdd69572bfced0cdf38c | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from django.conf.urls import url
from . import views
app_name = 'groups'
urlpatterns = [
path("", views.ListGroups.as_view(), name="all"),
path("new/", views.CreateGroup.as_view(), name="create"),
re_path(r"^posts/in/(?P<slug>[-\w]+)/$",views.SingleGroup.as_view(),n... | 31.125 | 87 | 0.646586 | from django.urls import path, re_path
from django.conf.urls import url
from . import views
app_name = 'groups'
urlpatterns = [
path("", views.ListGroups.as_view(), name="all"),
path("new/", views.CreateGroup.as_view(), name="create"),
re_path(r"^posts/in/(?P<slug>[-\w]+)/$",views.SingleGroup.as_view(),n... | true | true |
f7f223ed891cc2771efe934819f52333efdd0782 | 4,295 | py | Python | monoweb/mono/api/urlconfig.py | ragnraok/MonoReader | 4672f5f0ca48f69e9180b33b62e773ab323c2cbc | [
"MIT"
] | 1 | 2019-06-12T01:46:22.000Z | 2019-06-12T01:46:22.000Z | monoweb/mono/api/urlconfig.py | ragnraok/MonoReader | 4672f5f0ca48f69e9180b33b62e773ab323c2cbc | [
"MIT"
] | null | null | null | monoweb/mono/api/urlconfig.py | ragnraok/MonoReader | 4672f5f0ca48f69e9180b33b62e773ab323c2cbc | [
"MIT"
] | null | null | null | from flask import Blueprint
api_app = Blueprint("api", __name__)
def config_api_url():
from timeline import MainTimelineView, DailyReadTimelineView, TimelineCheckView
api_app.add_url_rule("/timeline/<int:page>/", view_func=MainTimelineView.as_view("timeline"))
api_app.add_url_rule("/fav_site_timeline/<int... | 74.051724 | 122 | 0.810012 | from flask import Blueprint
api_app = Blueprint("api", __name__)
def config_api_url():
from timeline import MainTimelineView, DailyReadTimelineView, TimelineCheckView
api_app.add_url_rule("/timeline/<int:page>/", view_func=MainTimelineView.as_view("timeline"))
api_app.add_url_rule("/fav_site_timeline/<int... | true | true |
f7f22492eebd3a2a7c072b3ce5397452e5c053e7 | 5,074 | py | Python | festivalA/migrations/0001_initial.py | mykonosbiennale/mykonosbiennale.github.io | fba479807204768ac440c77c4850b64fb25d113d | [
"Apache-2.0"
] | 1 | 2017-08-19T01:07:22.000Z | 2017-08-19T01:07:22.000Z | festivalA/migrations/0001_initial.py | thanos/mykonosbiennale.org | ddb53fbe4198ce29c252c72f9dca49ed277c50dc | [
"Apache-2.0"
] | 7 | 2015-04-02T04:48:43.000Z | 2022-03-11T23:14:58.000Z | festivalA/migrations/0001_initial.py | mykonosbiennale/mykonosbiennale.github.io | fba479807204768ac440c77c4850b64fb25d113d | [
"Apache-2.0"
] | 1 | 2015-04-15T20:56:03.000Z | 2015-04-15T20:56:03.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import phonenumber_field.modelfields
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = ... | 41.590164 | 166 | 0.558337 |
from __future__ import unicode_literals
from django.db import migrations, models
import phonenumber_field.modelfields
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.Cr... | true | true |
f7f224daa0346f90f6c80099cde39a4cfaffaa09 | 1,060 | py | Python | examples/opencv_gopro/gopro_opencv_photo.py | congduy/gopropyapi | 756b84896f289f3de852c51f373c4e1b9e7cf427 | [
"MIT"
] | 1,232 | 2017-03-10T13:06:18.000Z | 2022-03-30T04:26:43.000Z | examples/opencv_gopro/gopro_opencv_photo.py | congduy/gopropyapi | 756b84896f289f3de852c51f373c4e1b9e7cf427 | [
"MIT"
] | 168 | 2017-03-12T12:34:58.000Z | 2022-03-26T20:36:02.000Z | examples/opencv_gopro/gopro_opencv_photo.py | congduy/gopropyapi | 756b84896f289f3de852c51f373c4e1b9e7cf427 | [
"MIT"
] | 233 | 2017-03-28T15:02:56.000Z | 2022-03-31T05:59:34.000Z | import cv2
import numpy as np
from goprocam import GoProCamera
from goprocam import constants
import urllib.request
cascPath="/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml"
eyePath="/usr/share/opencv/haarcascades/haarcascade_eye.xml"
eye_cascade = cv2.CascadeClassifier(eyePath)
face_cascade = cv2.C... | 39.259259 | 79 | 0.750943 | import cv2
import numpy as np
from goprocam import GoProCamera
from goprocam import constants
import urllib.request
cascPath="/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml"
eyePath="/usr/share/opencv/haarcascades/haarcascade_eye.xml"
eye_cascade = cv2.CascadeClassifier(eyePath)
face_cascade = cv2.C... | true | true |
f7f22509feed2c7609a0a59773a03f994c049a55 | 18,743 | py | Python | glance/location.py | mail2nsrajesh/glance | 8bed0bc429a2213700b9f456631142b93f007fe2 | [
"Apache-2.0"
] | null | null | null | glance/location.py | mail2nsrajesh/glance | 8bed0bc429a2213700b9f456631142b93f007fe2 | [
"Apache-2.0"
] | null | null | null | glance/location.py | mail2nsrajesh/glance | 8bed0bc429a2213700b9f456631142b93f007fe2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 OpenStack Foundation
# 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 requ... | 36.607422 | 79 | 0.590887 |
import collections
import copy
from cryptography import exceptions as crypto_exception
from cursive import exception as cursive_exception
from cursive import signature_utils
import glance_store as store
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import encodeutils
fr... | true | true |
f7f2262b6fd081d87e429d86948893472d718df9 | 6,719 | py | Python | storm_control/sc_hardware/lumencor/celesta.py | BogdanBintu/STORM_Lemon | 3644a4046d108f079111b1a8adcc43e432157529 | [
"MIT"
] | null | null | null | storm_control/sc_hardware/lumencor/celesta.py | BogdanBintu/STORM_Lemon | 3644a4046d108f079111b1a8adcc43e432157529 | [
"MIT"
] | null | null | null | storm_control/sc_hardware/lumencor/celesta.py | BogdanBintu/STORM_Lemon | 3644a4046d108f079111b1a8adcc43e432157529 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Generic Lumencor laser control via HTTP (ethernet connection).
Bogdan 3/19
"""
import urllib.request
import traceback
def lumencor_httpcommand(command = 'GET IP',ip = '192.168.201.200'):
"""
Sends commands to the lumencor system via http.
Plese find commands here:
http://lumen... | 36.516304 | 119 | 0.618693 |
import urllib.request
import traceback
def lumencor_httpcommand(command = 'GET IP',ip = '192.168.201.200'):
command_full = r'http://'+ip+'/service/?command='+command.replace(' ','%20')
with urllib.request.urlopen(command_full) as response:
message = eval(response.read())
return message
class Lume... | true | true |
f7f2263271bb4d5d45d5dc64273f6e657b8099c6 | 1,135 | py | Python | tangrams_analysis/iristk.py | errantlinguist/tangrams-analysis | 4ca8e2e72210c9953154f0555f7c88337febf21a | [
"Apache-2.0"
] | null | null | null | tangrams_analysis/iristk.py | errantlinguist/tangrams-analysis | 4ca8e2e72210c9953154f0555f7c88337febf21a | [
"Apache-2.0"
] | null | null | null | tangrams_analysis/iristk.py | errantlinguist/tangrams-analysis | 4ca8e2e72210c9953154f0555f7c88337febf21a | [
"Apache-2.0"
] | null | null | null | """
Utilities for processing files used and created by IrisTK <http://www.iristk.net/>.
"""
__author__ = "Todd Shore <errantlinguist+github@gmail.com>"
__copyright__ = "Copyright 2017 Todd Shore"
__license__ = "Apache License, Version 2.0"
import datetime
LOGFILE_ENCODING = "utf-8"
def parse_timestamp(date_string:... | 39.137931 | 261 | 0.722467 |
__author__ = "Todd Shore <errantlinguist+github@gmail.com>"
__copyright__ = "Copyright 2017 Todd Shore"
__license__ = "Apache License, Version 2.0"
import datetime
LOGFILE_ENCODING = "utf-8"
def parse_timestamp(date_string: str) -> datetime.datetime:
try:
result = datetime.datetime.strptime(date_string, "%Y-... | true | true |
f7f2297f15c45f2c4e920f92cd2d04cde8fb4d81 | 1,022 | py | Python | Python Webcam_CMD_Video.py | toddkennedy/opencv_webcams | 8d4a6256f71e1015b949bb41022beaf3a98bbb7b | [
"MIT"
] | null | null | null | Python Webcam_CMD_Video.py | toddkennedy/opencv_webcams | 8d4a6256f71e1015b949bb41022beaf3a98bbb7b | [
"MIT"
] | null | null | null | Python Webcam_CMD_Video.py | toddkennedy/opencv_webcams | 8d4a6256f71e1015b949bb41022beaf3a98bbb7b | [
"MIT"
] | null | null | null | # Reference:
# Bielinskas, V. (2017, June 1). Intro and loading Images - OpenCV with Python
# for Image and Video Analysis 1. Retrieved October 28, 2017
# from https://www.youtube.com/watch?v=1XTqE7LFQjI
import cv2, time
#1. Create an object. Zero for external camera
video = cv2.VideoCapture(0) # The (0) repr... | 23.227273 | 81 | 0.641879 |
import cv2, time
video = cv2.VideoCapture(0)
check, frame = video.read()
print(check)
print(frame)
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow("Capturing", gray)
key = cv2.waitKey(1)
if key == ord('q'):
... | true | true |
f7f22a971231085c91369ecd61af019227197137 | 5,083 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ripng_cf5e0e826b2079e4dfc76d9c1ce9f4e8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ripng_cf5e0e826b2079e4dfc76d9c1ce9f4e8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/ripng_cf5e0e826b2079e4dfc76d9c1ce9f4e8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 35.795775 | 160 | 0.643321 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Ripng(Base):
__slots__ = ()
_SDM_NAME = 'ripng'
_SDM_ATT_MAP = {
'Enabled': 'enabled',
'NumRoutes': 'numRoutes',
'RunningState': 'runningState',
'TimePeri... | true | true |
f7f22aa2df3a6d11b29d9f0d1b0a1f520f1a32a7 | 6,229 | py | Python | frappe/website/doctype/website_settings/website_settings.py | maheshghadage/frappe-praman | 276df54479ec0bd9a665924ef94120864fa0931b | [
"MIT"
] | 1 | 2020-11-13T23:19:25.000Z | 2020-11-13T23:19:25.000Z | frappe/website/doctype/website_settings/website_settings.py | maheshghadage/frappe-praman | 276df54479ec0bd9a665924ef94120864fa0931b | [
"MIT"
] | 5 | 2021-04-28T06:55:26.000Z | 2022-02-10T07:59:06.000Z | frappe/website/doctype/website_settings/website_settings.py | maheshghadage/frappe-praman | 276df54479ec0bd9a665924ef94120864fa0931b | [
"MIT"
] | 2 | 2021-05-06T06:14:40.000Z | 2021-05-06T10:05:29.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_request_site_address, encode
from frappe.model.document import Document
from six.moves.urllib.parse import quote
fr... | 34.225275 | 128 | 0.733665 |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_request_site_address, encode
from frappe.model.document import Document
from six.moves.urllib.parse import quote
from frappe.website.router import resolve_route
from frappe.website.doctype.website_theme.website_th... | true | true |
f7f22ad3f05cbbbcb304a8f298a2abc797b5195f | 3,359 | py | Python | src/platform/tomcat/undeployer.py | 0x27/clusterd | 0f04a4955c61aa523274e9ae35d750f4339b1e59 | [
"MIT"
] | 539 | 2015-01-08T23:59:32.000Z | 2022-03-29T17:53:02.000Z | src/platform/tomcat/undeployer.py | M31MOTH/clusterd | d190b2cbaa93820e928a7ce5471c661d4559fb7c | [
"MIT"
] | 21 | 2015-01-17T21:51:21.000Z | 2019-09-20T09:23:18.000Z | src/platform/tomcat/undeployer.py | M31MOTH/clusterd | d190b2cbaa93820e928a7ce5471c661d4559fb7c | [
"MIT"
] | 192 | 2015-01-26T20:44:14.000Z | 2021-12-22T01:39:50.000Z | from src.platform.tomcat.authenticate import checkAuth
from src.platform.tomcat.interfaces import TINTERFACES
from src.module.deploy_utils import parse_war_path
from requests.utils import dict_from_cookiejar
from re import findall
from log import LOG
import utility
titles = [TINTERFACES.MAN]
def undeploy(fingerengine,... | 37.741573 | 85 | 0.62072 | from src.platform.tomcat.authenticate import checkAuth
from src.platform.tomcat.interfaces import TINTERFACES
from src.module.deploy_utils import parse_war_path
from requests.utils import dict_from_cookiejar
from re import findall
from log import LOG
import utility
titles = [TINTERFACES.MAN]
def undeploy(fingerengine,... | false | true |
f7f22af9a07fa54ffd65dc8dd6f2c16f0766e20d | 3,474 | py | Python | bindings/python/ensmallen/datasets/string/archaeongw2011ar20.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/archaeongw2011ar20.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/archaeongw2011ar20.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 archaeon GW2011_AR20.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein a... | 33.085714 | 223 | 0.677893 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def ArchaeonGw2011Ar20(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string... | true | true |
f7f22b126a6c0626dfce3f1711bf16c2978f5722 | 2,130 | py | Python | tests/algorithms/test_rna_to_protein.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | tests/algorithms/test_rna_to_protein.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | tests/algorithms/test_rna_to_protein.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | import unittest
from algorithms.rna_to_protein import protein
class RnaTest(unittest.TestCase):
def test1(self):
self.assertEqual(protein('AUGUGA'), 'M')
def test2(self):
self.assertEqual(protein('AUG'), 'M')
def test3(self):
self.assertEqual(protein('AUGGUUAGUUGA'), 'MVS')
... | 54.615385 | 703 | 0.814554 | import unittest
from algorithms.rna_to_protein import protein
class RnaTest(unittest.TestCase):
def test1(self):
self.assertEqual(protein('AUGUGA'), 'M')
def test2(self):
self.assertEqual(protein('AUG'), 'M')
def test3(self):
self.assertEqual(protein('AUGGUUAGUUGA'), 'MVS')
... | true | true |
f7f22b50f42d0db322e5b2729c3b55c969f2b220 | 5,801 | py | Python | contrib/seeds/makeseeds.py | 1024HQ/altcoin-sample | 87c087e062cce338a311563a32511667c12ef90b | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | 1024HQ/altcoin-sample | 87c087e062cce338a311563a32511667c12ef90b | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | 1024HQ/altcoin-sample | 87c087e062cce338a311563a32511667c12ef90b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
#... | 33.531792 | 186 | 0.571626 |
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 337600
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = {
"130.211.129.106", "178.63.107.226",
"83.81.130.26", "88.198.17.7", "148.251.238.178", "176.9.46.6",
"54.173.... | true | true |
f7f22b903387f3193bbbfcca5036f317d4d6b1af | 11,862 | py | Python | golosbase/account.py | golos-blockchain/golos-python | 1d88bdad700a5196175605ae6b6a61415bb0c29f | [
"MIT"
] | 2 | 2020-11-04T12:54:07.000Z | 2021-04-25T16:27:06.000Z | golosbase/account.py | golos-blockchain/golos-python | 1d88bdad700a5196175605ae6b6a61415bb0c29f | [
"MIT"
] | null | null | null | golosbase/account.py | golos-blockchain/golos-python | 1d88bdad700a5196175605ae6b6a61415bb0c29f | [
"MIT"
] | 1 | 2021-04-25T16:27:12.000Z | 2021-04-25T16:27:12.000Z | import hashlib
import os
import re
from binascii import hexlify, unhexlify
import ecdsa
from golosbase.base58 import Base58, ripemd160
from golosbase.dictionary import words as BrainKeyDictionary
class PasswordKey(object):
"""
This class derives a private key given the account name, the role and a password.... | 34.785924 | 117 | 0.628309 | import hashlib
import os
import re
from binascii import hexlify, unhexlify
import ecdsa
from golosbase.base58 import Base58, ripemd160
from golosbase.dictionary import words as BrainKeyDictionary
class PasswordKey(object):
def __init__(self, account, password, role="active"):
self.account = account
... | true | true |
f7f22bec666c234cf3851fb5f9f2515998d055d4 | 10,376 | py | Python | mtml/modeling/vte/mixed_models.py | crb479/mcdevitt-trauma-ml | 9ed7ed7cd1e4be0071a18f9bbf375414088d5ed2 | [
"MIT"
] | 5 | 2020-03-02T23:38:36.000Z | 2021-01-22T04:00:23.000Z | mtml/modeling/vte/mixed_models.py | crb479/mcdevitt-trauma-ml | 9ed7ed7cd1e4be0071a18f9bbf375414088d5ed2 | [
"MIT"
] | null | null | null | mtml/modeling/vte/mixed_models.py | crb479/mcdevitt-trauma-ml | 9ed7ed7cd1e4be0071a18f9bbf375414088d5ed2 | [
"MIT"
] | null | null | null | __doc__ = """Training routines containing mixed classifier types.
.. note::
This file has the potential to get cluttered like the
:mod:`mtml.modeling._vte_models` module that is now deprecated.
Mixed classifier training.
"""
# pylint: disable=import-error
import numpy as np
import pandas as pd
from sklearn.de... | 40.217054 | 80 | 0.659503 | __doc__ = """Training routines containing mixed classifier types.
.. note::
This file has the potential to get cluttered like the
:mod:`mtml.modeling._vte_models` module that is now deprecated.
Mixed classifier training.
"""
import numpy as np
import pandas as pd
from sklearn.decomposition import PCA
from sk... | true | true |
f7f22bf2ac8efce963e821e7f4e3d9d2ada40c5e | 1,112 | py | Python | citysim3d/envs/bbox3d_quad_panda3d_env.py | alexlee-gk/citysim3d | 37206572100e037f211f9cf1f947108765351c3d | [
"MIT"
] | 27 | 2016-11-24T04:42:23.000Z | 2021-10-15T01:43:51.000Z | citysim3d/envs/bbox3d_quad_panda3d_env.py | alexlee-gk/citysim3d | 37206572100e037f211f9cf1f947108765351c3d | [
"MIT"
] | 1 | 2020-05-02T15:34:25.000Z | 2020-05-02T15:34:25.000Z | citysim3d/envs/bbox3d_quad_panda3d_env.py | alexlee-gk/citysim3d | 37206572100e037f211f9cf1f947108765351c3d | [
"MIT"
] | 8 | 2017-04-05T12:54:07.000Z | 2021-08-03T06:46:40.000Z | import numpy as np
import itertools
from panda3d.core import Point3, BoundingBox
from citysim3d.envs import SimpleQuadPanda3dEnv
from citysim3d.spaces import BoxSpace
class Bbox3dSimpleQuadPanda3dEnv(SimpleQuadPanda3dEnv):
def __init__(self, *args, **kwargs):
super(Bbox3dSimpleQuadPanda3dEnv, self).__init... | 39.714286 | 110 | 0.71223 | import numpy as np
import itertools
from panda3d.core import Point3, BoundingBox
from citysim3d.envs import SimpleQuadPanda3dEnv
from citysim3d.spaces import BoxSpace
class Bbox3dSimpleQuadPanda3dEnv(SimpleQuadPanda3dEnv):
def __init__(self, *args, **kwargs):
super(Bbox3dSimpleQuadPanda3dEnv, self).__init... | true | true |
f7f22c03c6c3d2428b801fb586eddd18be14d381 | 728 | py | Python | Code/Python2.7/Kattis/24trik.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 1 | 2019-11-21T15:56:03.000Z | 2019-11-21T15:56:03.000Z | Code/Python2.7/Kattis/24trik.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 12 | 2019-11-21T21:00:57.000Z | 2022-02-27T01:46:56.000Z | Code/Python2.7/Kattis/24trik.py | nicholasz2510/General | e2783cad4da7f9b50c952c2b91ef311d22b1d56f | [
"MIT"
] | 1 | 2019-11-21T20:49:18.000Z | 2019-11-21T20:49:18.000Z | from sys import stdin
moves = stdin.readline()
cups = [1, 0, 0]
for m in moves:
if m == "A":
if cups[0] != cups[1]:
if cups[0] == 1:
cups[0] = 0
cups[1] = 1
else:
cups[0] = 1
cups[1] = 0
if m == "B":
if cup... | 22.060606 | 30 | 0.31044 | from sys import stdin
moves = stdin.readline()
cups = [1, 0, 0]
for m in moves:
if m == "A":
if cups[0] != cups[1]:
if cups[0] == 1:
cups[0] = 0
cups[1] = 1
else:
cups[0] = 1
cups[1] = 0
if m == "B":
if cup... | false | true |
f7f22d0259b1be91130782a6b7eea512cf7e20f6 | 3,270 | py | Python | invenio_rdm_records/searchconfig.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 10 | 2020-01-17T10:13:09.000Z | 2022-03-17T10:14:41.000Z | invenio_rdm_records/searchconfig.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 570 | 2019-08-15T16:35:25.000Z | 2022-03-31T13:46:17.000Z | invenio_rdm_records/searchconfig.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 57 | 2019-09-04T09:25:29.000Z | 2022-03-30T19:32:55.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018-2021 CERN.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Search app configuration helper."""
# NOTE: It would be best to try to better harmonize these classe... | 34.0625 | 79 | 0.644343 |
class OptionsSelector:
def __init__(self, available_options, selected_options):
for o in selected_options:
assert o in available_options, \
f"Selected option '{o}' is undefined."
self.available_options = available_options
self.selected... | true | true |
f7f22d62b600ac935e5e76bbab6674f338e23572 | 108 | py | Python | python/test/test_import.py | fbi-octopus/biggles | 2dac4f1748ab87242951239caf274f302be1143a | [
"Apache-2.0"
] | 1 | 2019-11-15T14:01:59.000Z | 2019-11-15T14:01:59.000Z | python/test/test_import.py | fbi-octopus/biggles | 2dac4f1748ab87242951239caf274f302be1143a | [
"Apache-2.0"
] | null | null | null | python/test/test_import.py | fbi-octopus/biggles | 2dac4f1748ab87242951239caf274f302be1143a | [
"Apache-2.0"
] | null | null | null | import sys
import unittest
import biggles
if __name__ == '__main__':
unittest.main(argv=sys.argv[:1])
| 13.5 | 36 | 0.722222 | import sys
import unittest
import biggles
if __name__ == '__main__':
unittest.main(argv=sys.argv[:1])
| true | true |
f7f22e056aa710987e889f8426439930dc4e0078 | 24,108 | py | Python | tests/web/classes/test_blocks.py | priya1puresoftware/python-slack-sdk | 3503182feaaf4d41b57fd8bf10038ebc99f1f3c7 | [
"MIT"
] | 2,486 | 2016-11-03T14:31:43.000Z | 2020-10-26T23:07:44.000Z | tests/web/classes/test_blocks.py | priya1puresoftware/python-slack-sdk | 3503182feaaf4d41b57fd8bf10038ebc99f1f3c7 | [
"MIT"
] | 721 | 2016-11-03T21:26:56.000Z | 2020-10-26T12:41:29.000Z | tests/web/classes/test_blocks.py | priya1puresoftware/python-slack-sdk | 3503182feaaf4d41b57fd8bf10038ebc99f1f3c7 | [
"MIT"
] | 627 | 2016-11-02T19:04:19.000Z | 2020-10-25T19:21:13.000Z | import unittest
from typing import List
from slack.errors import SlackObjectFormationError
from slack.web.classes.blocks import (
ActionsBlock,
ContextBlock,
DividerBlock,
HeaderBlock,
ImageBlock,
SectionBlock,
InputBlock,
FileBlock,
Block,
CallBlock,
)
from slack.web.classes.el... | 34.98984 | 101 | 0.404969 | import unittest
from typing import List
from slack.errors import SlackObjectFormationError
from slack.web.classes.blocks import (
ActionsBlock,
ContextBlock,
DividerBlock,
HeaderBlock,
ImageBlock,
SectionBlock,
InputBlock,
FileBlock,
Block,
CallBlock,
)
from slack.web.classes.el... | true | true |
f7f22e084ea318bfe71cdeeb0a588c855867ef7c | 3,583 | py | Python | app/file_manager.py | makstsar17/ToDoBackend | 06d99a1879387f6b57a7c3c250f0edb003d976ba | [
"MIT"
] | null | null | null | app/file_manager.py | makstsar17/ToDoBackend | 06d99a1879387f6b57a7c3c250f0edb003d976ba | [
"MIT"
] | null | null | null | app/file_manager.py | makstsar17/ToDoBackend | 06d99a1879387f6b57a7c3c250f0edb003d976ba | [
"MIT"
] | null | null | null | import json
from flask import request, jsonify, Blueprint, send_from_directory
from werkzeug.utils import secure_filename
from flask_jwt_extended import jwt_required, get_jwt_identity
from util.file_util import allowed_file, UPLOAD_FOLDER_TEMPORARY, create_dir_for_user, create_dir_for_task
from instance.config import ... | 33.175926 | 112 | 0.655596 | import json
from flask import request, jsonify, Blueprint, send_from_directory
from werkzeug.utils import secure_filename
from flask_jwt_extended import jwt_required, get_jwt_identity
from util.file_util import allowed_file, UPLOAD_FOLDER_TEMPORARY, create_dir_for_user, create_dir_for_task
from instance.config import ... | true | true |
f7f22ea8ea3bcdff06a78ecede3039ef50de6c07 | 669 | py | Python | invenio_previewer/extensions/default.py | invenio-toaster/invenio-previewer | ac360d02a6628c8ed12983f8717bc229f6122acd | [
"MIT"
] | null | null | null | invenio_previewer/extensions/default.py | invenio-toaster/invenio-previewer | ac360d02a6628c8ed12983f8717bc229f6122acd | [
"MIT"
] | null | null | null | invenio_previewer/extensions/default.py | invenio-toaster/invenio-previewer | ac360d02a6628c8ed12983f8717bc229f6122acd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Default rendering returning a default web page."""
from __future__ import absolut... | 25.730769 | 77 | 0.733931 |
from __future__ import absolute_import, print_function
from flask import render_template
previewable_extensions = []
def can_preview(file):
return True
def preview(file):
return render_template("invenio_previewer/default.html", file=file)
| true | true |
f7f22edcba4008eabedab66373e0e7affaebae34 | 160,523 | py | Python | python_wrapper/test_functional/test_RD_LBP_P252g_R3.py | johndpope/ext3DLBP | 0704ae6a9dda7e74f1f52b45acd71d1b6f622efd | [
"MIT"
] | null | null | null | python_wrapper/test_functional/test_RD_LBP_P252g_R3.py | johndpope/ext3DLBP | 0704ae6a9dda7e74f1f52b45acd71d1b6f622efd | [
"MIT"
] | null | null | null | python_wrapper/test_functional/test_RD_LBP_P252g_R3.py | johndpope/ext3DLBP | 0704ae6a9dda7e74f1f52b45acd71d1b6f622efd | [
"MIT"
] | null | null | null | '''
=========================================================================
Author: Leonardo Citraro
Company:
Filename:
Last modifed: 06.04.2017 by Leonardo Citraro
Description: Functional test
=========================================================================
================================... | 99.149475 | 204 | 0.653994 | import numpy as np
import ext3DLBPpy
print("=============================================")
test = "RD_LBP_P252g_R3"
array = np.array([
[[4,62,9,218,14,207,231],[28,28,32,70,169,207,55],[145,53,26,190,196,162,145],[144,167,142,67,223,153,105],[161,11,163,198,189,22,95],[123,107,248,61,205,169,155],[238,70,58... | true | true |
f7f22f8bf702a888f8f22e5c9dc25e6e8e27a57b | 6,107 | py | Python | models.py | linn24/diamond-grocery | a9c947f49e60ae6bf4980decfee38d4eb6bda672 | [
"MIT"
] | null | null | null | models.py | linn24/diamond-grocery | a9c947f49e60ae6bf4980decfee38d4eb6bda672 | [
"MIT"
] | null | null | null | models.py | linn24/diamond-grocery | a9c947f49e60ae6bf4980decfee38d4eb6bda672 | [
"MIT"
] | null | null | null | import sys
from sqlalchemy import Column, ForeignKey, Integer, String, Date, Numeric
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
import os
from decouple import config
from passlib.hash import bcrypt
Base = declarative_base()
cla... | 27.263393 | 103 | 0.614213 | import sys
from sqlalchemy import Column, ForeignKey, Integer, String, Date, Numeric
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
import os
from decouple import config
from passlib.hash import bcrypt
Base = declarative_base()
cla... | true | true |
f7f22ffe913c47cab15fbe3d3dcb265804e99d7d | 3,544 | py | Python | datavis/audio_io.py | rfcx/audio-feature-visuals | b2a0ce2e38b477647142c63e008eca3e4e08af7b | [
"Apache-2.0"
] | 1 | 2021-01-05T17:14:02.000Z | 2021-01-05T17:14:02.000Z | datavis/audio_io.py | rfcx/audio-feature-visuals | b2a0ce2e38b477647142c63e008eca3e4e08af7b | [
"Apache-2.0"
] | null | null | null | datavis/audio_io.py | rfcx/audio-feature-visuals | b2a0ce2e38b477647142c63e008eca3e4e08af7b | [
"Apache-2.0"
] | null | null | null | import os
import re
import glob
import logging
import pandas as pd
from io import StringIO
from typing import Generator, Tuple
from joblib import Parallel, delayed
from datetime import datetime
from pathlib import Path, PosixPath
class AudioIOException(Exception):
pass
def get_all_waves_generator(directory: str... | 32.814815 | 117 | 0.652935 | import os
import re
import glob
import logging
import pandas as pd
from io import StringIO
from typing import Generator, Tuple
from joblib import Parallel, delayed
from datetime import datetime
from pathlib import Path, PosixPath
class AudioIOException(Exception):
pass
def get_all_waves_generator(directory: str... | true | true |
f7f23048f14f8d2ed3847879a911eff2e0a21110 | 3,216 | py | Python | qa/rpc-tests/bipdersig.py | jtoomim/BitcoinUnlimited | b7b9b59a8440f720c5e0c3d5aeb1bcc4e48f1b9c | [
"MIT"
] | 2 | 2019-09-22T21:06:32.000Z | 2019-09-22T21:06:34.000Z | qa/rpc-tests/bipdersig.py | jtoomim/BitcoinUnlimited | b7b9b59a8440f720c5e0c3d5aeb1bcc4e48f1b9c | [
"MIT"
] | null | null | null | qa/rpc-tests/bipdersig.py | jtoomim/BitcoinUnlimited | b7b9b59a8440f720c5e0c3d5aeb1bcc4e48f1b9c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import test_framework.loginit
#
# Test the BIP6... | 36.134831 | 98 | 0.628109 |
import test_framework.loginit
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class BIP66Test(BitcoinTestFramework):
def setup_network(self):
self.nodes = []
self.nodes.append(start_node(0, self.options.tmpdir, []))
self.nodes.appen... | true | true |
f7f2304e5ed7e7ceee9d988425e2ec885f2acbcc | 1,262 | py | Python | CnnModel_identifyCar_pred.py | marx1992620/cnn_keras_filtercars | 415eb629069d13f7e2c661bf6f6d7fb5a96e16de | [
"MIT"
] | null | null | null | CnnModel_identifyCar_pred.py | marx1992620/cnn_keras_filtercars | 415eb629069d13f7e2c661bf6f6d7fb5a96e16de | [
"MIT"
] | null | null | null | CnnModel_identifyCar_pred.py | marx1992620/cnn_keras_filtercars | 415eb629069d13f7e2c661bf6f6d7fb5a96e16de | [
"MIT"
] | null | null | null | # --coding:utf-8--
from keras.preprocessing.image import ImageDataGenerator
from keras.preprocessing import image
from keras.models import load_model
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
train_dir = r'E:\car_pic\training_in_out'
validation_dir = r'E:\car_pic\validation_in_out'
test... | 22.535714 | 62 | 0.743265 |
from keras.preprocessing.image import ImageDataGenerator
from keras.preprocessing import image
from keras.models import load_model
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
train_dir = r'E:\car_pic\training_in_out'
validation_dir = r'E:\car_pic\validation_in_out'
test_dir = r'E:\car_pi... | true | true |
f7f230843fb680e4b640e45fbdcdb3febab5b3e9 | 11,686 | py | Python | broadlink/switch.py | JDiaz11/python-broadlink | 7de798fd4d770cee51dc8347513d71517283c07b | [
"MIT"
] | null | null | null | broadlink/switch.py | JDiaz11/python-broadlink | 7de798fd4d770cee51dc8347513d71517283c07b | [
"MIT"
] | null | null | null | broadlink/switch.py | JDiaz11/python-broadlink | 7de798fd4d770cee51dc8347513d71517283c07b | [
"MIT"
] | null | null | null | """Support for switches."""
import json
import struct
from .device import device
from .exceptions import check_error
class mp1(device):
"""Controls a Broadlink MP1."""
def __init__(self, *args, **kwargs) -> None:
"""Initialize the controller."""
device.__init__(self, *args, **kwargs)
... | 32.733894 | 117 | 0.559045 | import json
import struct
from .device import device
from .exceptions import check_error
class mp1(device):
def __init__(self, *args, **kwargs) -> None:
device.__init__(self, *args, **kwargs)
self.type = "MP1"
def set_power_mask(self, sid_mask: int, state: bool) -> None:
packet = by... | true | true |
f7f2328b6215cdf0057e5d6c669d743748136e4c | 3,865 | py | Python | tests/test_paginator.py | SnowyLuma/jishaku | 300c5286a9a1b17da1086f7c59842254263082a2 | [
"MIT"
] | 1 | 2021-07-14T16:57:08.000Z | 2021-07-14T16:57:08.000Z | tests/test_paginator.py | SnowyLuma/jishaku | 300c5286a9a1b17da1086f7c59842254263082a2 | [
"MIT"
] | null | null | null | tests/test_paginator.py | SnowyLuma/jishaku | 300c5286a9a1b17da1086f7c59842254263082a2 | [
"MIT"
] | 1 | 2021-04-29T17:04:13.000Z | 2021-04-29T17:04:13.000Z | # -*- coding: utf-8 -*-
"""
jishaku converter test
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2019 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import inspect
from io import BytesIO
import discord
import pytest
from discord.ext import commands
from jishaku.paginators import FilePaginator, Pagin... | 27.027972 | 107 | 0.688228 |
import inspect
from io import BytesIO
import discord
import pytest
from discord.ext import commands
from jishaku.paginators import FilePaginator, PaginatorEmbedInterface, PaginatorInterface, WrappedPaginator
def test_file_paginator():
base_text = inspect.cleandoc("""
#!/usr/bin/env python
# -*- codi... | true | true |
f7f23294ac1f472c643577b9a5e1e97769b74031 | 1,948 | py | Python | preprocess/combine_data.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | preprocess/combine_data.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | preprocess/combine_data.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
def file_combine(start,finish):
combine_df = pd.DataFrame()
for i in range(start,finish,500):
temp = pd.read_csv("~/Desktop/Chess/data/train_data{}".format(i), index_col = 0)
combine_df = combine_df.append(temp, ignore_index=True)
print (i)
re... | 33.016949 | 88 | 0.651437 | import numpy as np
import pandas as pd
def file_combine(start,finish):
combine_df = pd.DataFrame()
for i in range(start,finish,500):
temp = pd.read_csv("~/Desktop/Chess/data/train_data{}".format(i), index_col = 0)
combine_df = combine_df.append(temp, ignore_index=True)
print (i)
re... | true | true |
f7f232bad79fda4b2dce1ceac92fddc9965c8937 | 804 | py | Python | naive_test.py | Sivatejareddyseelam/spark_cnn | f25a79a4d00bf03c7e94e29e78e669271e024120 | [
"MIT"
] | null | null | null | naive_test.py | Sivatejareddyseelam/spark_cnn | f25a79a4d00bf03c7e94e29e78e669271e024120 | [
"MIT"
] | null | null | null | naive_test.py | Sivatejareddyseelam/spark_cnn | f25a79a4d00bf03c7e94e29e78e669271e024120 | [
"MIT"
] | null | null | null | # test the performance of learnt CNN on its corresponding training data
import sys
import numpy as np
from spark.utils import *
from spark.cnn import CNN
from time import time
def test(size):
print('Testing naive CNN for %d testing images' % (size))
start = time()
cnn = CNN(0)
X, Y = load_testing_data(... | 26.8 | 71 | 0.619403 |
import sys
import numpy as np
from spark.utils import *
from spark.cnn import CNN
from time import time
def test(size):
print('Testing naive CNN for %d testing images' % (size))
start = time()
cnn = CNN(0)
X, Y = load_testing_data(0, size)
P = cnn.predict(X)
P = np.argmax(P, 1)
print('Pred... | true | true |
f7f23409a7ef7c7815d306d2c1e86d3557783312 | 315 | py | Python | robot/threads.py | Pecius/RobotArm | 6c50d0587222d1531c823e7e219a34f6c7324501 | [
"MIT"
] | null | null | null | robot/threads.py | Pecius/RobotArm | 6c50d0587222d1531c823e7e219a34f6c7324501 | [
"MIT"
] | null | null | null | robot/threads.py | Pecius/RobotArm | 6c50d0587222d1531c823e7e219a34f6c7324501 | [
"MIT"
] | null | null | null | from _thread import start_new_thread
from robot import input
from robot import ui
from robot import st
RA = start_new_thread("RobotArm", st.main, (), None, True, 1024*7)
Input = start_new_thread("Input", input.main, (), None, False, 1024*7)
UI = start_new_thread("UI", ui.main, (), None, True, 1024*9)
| 31.5 | 71 | 0.698413 | from _thread import start_new_thread
from robot import input
from robot import ui
from robot import st
RA = start_new_thread("RobotArm", st.main, (), None, True, 1024*7)
Input = start_new_thread("Input", input.main, (), None, False, 1024*7)
UI = start_new_thread("UI", ui.main, (), None, True, 1024*9)
| true | true |
f7f2343681ea17f76dbd08bc8d1c6e1f10ee150d | 11,939 | py | Python | roberta_mbs_optim/usnavy_tweet_sentiment_sh.py | krzysztoffiok/twitter_sentiment_to_usnavy | 673e01336242348d9aa79e6e9b3385222bcd62d7 | [
"MIT"
] | 2 | 2021-02-19T11:17:03.000Z | 2021-11-04T06:30:48.000Z | roberta_mbs_optim/usnavy_tweet_sentiment_sh.py | krzysztoffiok/twitter_sentiment_to_usnavy | 673e01336242348d9aa79e6e9b3385222bcd62d7 | [
"MIT"
] | null | null | null | roberta_mbs_optim/usnavy_tweet_sentiment_sh.py | krzysztoffiok/twitter_sentiment_to_usnavy | 673e01336242348d9aa79e6e9b3385222bcd62d7 | [
"MIT"
] | 1 | 2020-05-03T09:10:21.000Z | 2020-05-03T09:10:21.000Z | import pandas as pd
import numpy as np
from sklearn.metrics import classification_report
from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier
from sklearn.naive_bayes import BernoulliNB, GaussianNB
import sklearn
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection impor... | 47.376984 | 121 | 0.689421 | import pandas as pd
import numpy as np
from sklearn.metrics import classification_report
from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier
from sklearn.naive_bayes import BernoulliNB, GaussianNB
import sklearn
from sklearn.naive_bayes import MultinomialNB
from sklearn.model_selection impor... | true | true |
f7f2348a24762951e9a8daf677a5856fd6e1d31c | 5,700 | py | Python | main.py | loitd/pythonimageviewer | 45403142763e4bea3800dc3cfe22de68c2bcefd8 | [
"MIT"
] | null | null | null | main.py | loitd/pythonimageviewer | 45403142763e4bea3800dc3cfe22de68c2bcefd8 | [
"MIT"
] | null | null | null | main.py | loitd/pythonimageviewer | 45403142763e4bea3800dc3cfe22de68c2bcefd8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# Project Name: PythonImageViewer - Created Date: Tuesday September 22nd 2020
# Author: loitd - Email: loitranduc@gmail.com
# Description: This is a short project/file description
# Copyright (c) 2020 loitd. WWW: https://github.com/loitd
# -----
# Last Modified: Tuesday... | 34.337349 | 147 | 0.645439 |
rom sys import argv
from tkinter import Tk, Canvas, NW, YES, BOTH, Frame, X, Y, TOP, LEFT, FLAT, ALL, filedialog, Menu, PhotoImage, messagebox
from PIL import Image, ImageTk
def cal_fitsize(imsize, cvsize):
global withpil
if withpil:
ratiow = cvsize[0]/imsize[0]
ratioh = cvsize[1]/i... | true | true |
f7f235555673e7a31c13d548ac6b680222827791 | 520 | py | Python | src/main/python/actions/quit_action.py | michaelbradley91/NASM-Debugger | c7b5593cfa2583c48c6607ee6e7d608c486bce0a | [
"MIT"
] | null | null | null | src/main/python/actions/quit_action.py | michaelbradley91/NASM-Debugger | c7b5593cfa2583c48c6607ee6e7d608c486bce0a | [
"MIT"
] | null | null | null | src/main/python/actions/quit_action.py | michaelbradley91/NASM-Debugger | c7b5593cfa2583c48c6607ee6e7d608c486bce0a | [
"MIT"
] | null | null | null | from PyQt5.QtCore import QObject, pyqtSlot
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction
from service_locator import get_resource, signals
class QuitAction(QAction):
def __init__(self, parent: QObject):
super().__init__(QIcon(get_resource("quit.svg")), "&Quit", parent)
self.se... | 28.888889 | 74 | 0.711538 | from PyQt5.QtCore import QObject, pyqtSlot
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction
from service_locator import get_resource, signals
class QuitAction(QAction):
def __init__(self, parent: QObject):
super().__init__(QIcon(get_resource("quit.svg")), "&Quit", parent)
self.se... | true | true |
f7f2355b390cfe555cff81a202249f49e8bfcb9d | 725 | py | Python | examples/translate_using_tor_service.py | sinedie/SRT-DeepL-traslator | 18f70ee70506160363f87b8fcd12c80180fa9eb6 | [
"WTFPL"
] | null | null | null | examples/translate_using_tor_service.py | sinedie/SRT-DeepL-traslator | 18f70ee70506160363f87b8fcd12c80180fa9eb6 | [
"WTFPL"
] | null | null | null | examples/translate_using_tor_service.py | sinedie/SRT-DeepL-traslator | 18f70ee70506160363f87b8fcd12c80180fa9eb6 | [
"WTFPL"
] | null | null | null | import logging
logging.basicConfig(level=logging.INFO)
from selenium import webdriver
from srt_deepl import translate
profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.socks", "127.0.0.1")
profile.set_preference("network.proxy.socks_port", 9050... | 25.892857 | 58 | 0.762759 | import logging
logging.basicConfig(level=logging.INFO)
from selenium import webdriver
from srt_deepl import translate
profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.socks", "127.0.0.1")
profile.set_preference("network.proxy.socks_port", 9050... | true | true |
f7f2359a9eb67d33397c0c85c5cc589cb93106ed | 14,950 | py | Python | coronet/util_tf_v2_migrated.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | coronet/util_tf_v2_migrated.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | coronet/util_tf_v2_migrated.py | sabuj7177/CovidProject | b4b7bcfa5ace165520507f489dc74da7b695e2f0 | [
"Apache-2.0"
] | null | null | null | from numpy import linalg as LA
import numpy as np
import bingrad_common_updated
import tensorflow as tf
def ternary_encoder(input_data):
"""Encoding and compressing the signs """
a = tf.sign(input_data) # -1, 0, 1
a = tf.add(a, 1) # shift -1,0,1 to 0,1,2 (2'b00,2'b01,2'b10)
a = tf.reshape(a, [-1])
... | 38.932292 | 120 | 0.664415 | from numpy import linalg as LA
import numpy as np
import bingrad_common_updated
import tensorflow as tf
def ternary_encoder(input_data):
a = tf.sign(input_data)
a = tf.add(a, 1)
a = tf.reshape(a, [-1])
pad_size = 4 - tf.compat.v1.mod(tf.size(input=a), 4)
pad = tf.range(0.0, pad_size)
a = t... | true | true |
f7f237f52257411df0adfe40a10b057f93f83cef | 22,308 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_07_01/aio/operations/_inbound_nat_rules_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.282759 | 232 | 0.677784 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f7f238338ee7a73a53c07dfade3a91ac6180ece6 | 31,098 | py | Python | lib-python/2.7/test/test_sys.py | ruby-compiler-survey/pypy | c76ed8d0979e13497786cf99eb427ef8f94ea816 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-07-19T17:42:42.000Z | 2021-07-19T17:42:42.000Z | lib-python/2.7/test/test_sys.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib-python/2.7/test/test_sys.py | CAS-Atlantic/pypy | 0988788dd911ff0d5b1cfcf0657412810168d37e | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | # -*- coding: iso-8859-1 -*-
import unittest, test.test_support
from test.script_helper import assert_python_ok, assert_python_failure
import cStringIO
import gc
import operator
import os
import struct
import sys
class SysModuleTest(unittest.TestCase):
def tearDown(self):
test.test_support.reap_children()... | 36.88968 | 79 | 0.589234 |
import unittest, test.test_support
from test.script_helper import assert_python_ok, assert_python_failure
import cStringIO
import gc
import operator
import os
import struct
import sys
class SysModuleTest(unittest.TestCase):
def tearDown(self):
test.test_support.reap_children()
def test_original_disp... | false | true |
f7f238444f86026d6449caabb58b2dbb44e0a6a8 | 2,866 | py | Python | agro_site/agroblog/views.py | LukoninDmitryPy/agro_site-2 | eab7694d42104774e5ce6db05a79f11215db6ae3 | [
"MIT"
] | null | null | null | agro_site/agroblog/views.py | LukoninDmitryPy/agro_site-2 | eab7694d42104774e5ce6db05a79f11215db6ae3 | [
"MIT"
] | null | null | null | agro_site/agroblog/views.py | LukoninDmitryPy/agro_site-2 | eab7694d42104774e5ce6db05a79f11215db6ae3 | [
"MIT"
] | 1 | 2022-03-13T11:32:48.000Z | 2022-03-13T11:32:48.000Z | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, render
from .forms import CommentF... | 29.244898 | 71 | 0.682833 | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, render
from .forms import CommentF... | true | true |
f7f239261115794ebc79b6176a1240bfa5cb8f3e | 409 | py | Python | pyspedas/csswe/config.py | amanotk/pyspedas | ba38f9a318fe96911a0fb3d6fce53e8b1a534ff4 | [
"MIT"
] | null | null | null | pyspedas/csswe/config.py | amanotk/pyspedas | ba38f9a318fe96911a0fb3d6fce53e8b1a534ff4 | [
"MIT"
] | null | null | null | pyspedas/csswe/config.py | amanotk/pyspedas | ba38f9a318fe96911a0fb3d6fce53e8b1a534ff4 | [
"MIT"
] | null | null | null | import os
CONFIG = {'local_data_dir': 'csswe_data/',
'remote_data_dir': 'https://spdf.sci.gsfc.nasa.gov/pub/data/csswe/'}
# override local data directory with environment variables
if os.environ.get('ROOT_DATA_DIR'):
CONFIG['local_data_dir'] = os.sep.join([os.environ['ROOT_DATA_DIR'], 'csswe'])
if os.e... | 37.181818 | 82 | 0.713936 | import os
CONFIG = {'local_data_dir': 'csswe_data/',
'remote_data_dir': 'https://spdf.sci.gsfc.nasa.gov/pub/data/csswe/'}
if os.environ.get('ROOT_DATA_DIR'):
CONFIG['local_data_dir'] = os.sep.join([os.environ['ROOT_DATA_DIR'], 'csswe'])
if os.environ.get('CSSWE_DATA_DIR'):
CONFIG['local_data_dir']... | true | true |
f7f23a8d45a5ecad3a38025623e2d483026976ee | 1,472 | py | Python | python/fate_client/pipeline/component/hetero_fast_secureboost.py | eliaskousk/FATE | 242e47d6ae439a3b69ecb1610cb370b29b024413 | [
"Apache-2.0"
] | 1 | 2022-02-07T06:23:15.000Z | 2022-02-07T06:23:15.000Z | python/fate_client/pipeline/component/hetero_fast_secureboost.py | eliaskousk/FATE | 242e47d6ae439a3b69ecb1610cb370b29b024413 | [
"Apache-2.0"
] | null | null | null | python/fate_client/pipeline/component/hetero_fast_secureboost.py | eliaskousk/FATE | 242e47d6ae439a3b69ecb1610cb370b29b024413 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The FATE 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 appli... | 36.8 | 75 | 0.752717 |
from pipeline.param.boosting_param import HeteroFastSecureBoostParam
from pipeline.component.component_base import FateComponent
from pipeline.constant import ProviderType
from pipeline.interface import Input
from pipeline.interface import Output
from pipeline.utils.logger import LOGGER
class HeteroF... | true | true |
f7f23aa183f90e5f3d78823c9a8716ca616f27de | 40,807 | py | Python | graphene_rpc.py | abitmore/Graphene-Metanode | 211e751293f2916e3f7307d5b66962a95fe0844e | [
"MIT"
] | 3 | 2022-02-01T21:22:49.000Z | 2022-02-02T12:26:56.000Z | graphene_rpc.py | abitmore/Graphene-Metanode | 211e751293f2916e3f7307d5b66962a95fe0844e | [
"MIT"
] | null | null | null | graphene_rpc.py | abitmore/Graphene-Metanode | 211e751293f2916e3f7307d5b66962a95fe0844e | [
"MIT"
] | 6 | 2022-02-01T21:22:54.000Z | 2022-02-07T23:45:04.000Z | #!/usr/bin/env python
# DISABLE SELECT PYLINT TESTS
# pylint: disable=import-error, broad-except, bad-continuation, line-too-long
# pylint: disable=too-many-locals, too-many-public-methods, too-many-function-args
# pylint: disable=too-many-lines
r"""
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ββββ¦ββββββ... | 40.40297 | 88 | 0.487367 |
import json
import time
from random import shuffle
from websocket import create_connection as wss_connect
from graphene_constants import GrapheneConstants
from graphene_metanode_client import GrapheneTrustlessClient
from graphene_utils import (blip, from_iso_date, invert_pairs, it, jprint,
... | true | true |
f7f23b5770f0a24b256e88cb37d884d01c3e60b0 | 20,566 | py | Python | google/cloud/compute_v1/services/region_commitments/transports/rest.py | TheJokersThief/python-compute | 76a1d29909ab1346a7de55c15198aa057a4a50e1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/region_commitments/transports/rest.py | TheJokersThief/python-compute | 76a1d29909ab1346a7de55c15198aa057a4a50e1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/region_commitments/transports/rest.py | TheJokersThief/python-compute | 76a1d29909ab1346a7de55c15198aa057a4a50e1 | [
"Apache-2.0"
] | null | null | null | from google.auth.transport.requests import AuthorizedSession # type: ignore
import json # type: ignore
import grpc # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.api_core import exceptions as core_... | 38.585366 | 98 | 0.625353 | from google.auth.transport.requests import AuthorizedSession
import json
import grpc
from google.auth.transport.grpc import SslCredentials
from google.auth import credentials as ga_credentials
from google.api_core import exceptions as core_exceptions
from google.api_core import retry as retries
from google.ap... | true | true |
f7f23ba431db01f4e1c4ad928719a27a44abc789 | 5,599 | py | Python | Detection-Pytorch/backbone/VGG.py | swpucwf/Deeplearning | be19885d52b7ce8782949d931a1b2994de36679f | [
"Apache-2.0"
] | 1 | 2020-06-06T03:13:05.000Z | 2020-06-06T03:13:05.000Z | Detection-Pytorch/backbone/VGG.py | swpucwf/deeplearning | be19885d52b7ce8782949d931a1b2994de36679f | [
"Apache-2.0"
] | null | null | null | Detection-Pytorch/backbone/VGG.py | swpucwf/deeplearning | be19885d52b7ce8782949d931a1b2994de36679f | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
import torch.nn.functional as F
class VGG11(nn.Module):
def __init__(self,num_classes=1000):
super(VGG11, self).__init__()
in_dims = 3
out_dims =64
layers = []
for i in range(8):
layers+=[nn.Conv2d(in_dims,out_dims,3,1,1),nn.... | 28.712821 | 84 | 0.50384 | import torch
from torch import nn
import torch.nn.functional as F
class VGG11(nn.Module):
def __init__(self,num_classes=1000):
super(VGG11, self).__init__()
in_dims = 3
out_dims =64
layers = []
for i in range(8):
layers+=[nn.Conv2d(in_dims,out_dims,3,1,1),nn.... | true | true |
f7f23bc8f42c53028d1eef818bb2bcf39dc2c0a5 | 28,989 | py | Python | test/functional/rpc_psbt.py | nigug/Slimcoin | 1ab11eb5f33e07d4ca6b02bab634d8ea539648b3 | [
"MIT"
] | 1 | 2020-08-18T00:57:12.000Z | 2020-08-18T00:57:12.000Z | test/functional/rpc_psbt.py | nigug/Slimcoin | 1ab11eb5f33e07d4ca6b02bab634d8ea539648b3 | [
"MIT"
] | 1 | 2021-09-30T02:47:32.000Z | 2021-09-30T02:48:40.000Z | test/functional/rpc_psbt.py | nigug/Slimcoin | 1ab11eb5f33e07d4ca6b02bab634d8ea539648b3 | [
"MIT"
] | 1 | 2020-11-04T06:59:46.000Z | 2020-11-04T06:59:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from test_framework.test_f... | 59.161224 | 584 | 0.680017 |
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_greater_than,
assert_raises_rpc_error,
connect_nodes,
disconnect_nodes,
find_output,
)
import json
import os
MAX_BIP125_RBF_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.