hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f772c31c7e2593fbaf3a96684a2e1bb1cbbe58db | 5,863 | py | Python | CustomMayaRenderer/scripts/globalsNode.py | Uedaki/CustomMayaRenderer | 2510c8e1721a7d13545ec65f671260f3de125ff0 | [
"MIT"
] | 5 | 2019-11-13T17:50:41.000Z | 2021-07-12T16:05:13.000Z | CustomMayaRenderer/scripts/globalsNode.py | Uedaki/CustomMayaRenderer | 2510c8e1721a7d13545ec65f671260f3de125ff0 | [
"MIT"
] | null | null | null | CustomMayaRenderer/scripts/globalsNode.py | Uedaki/CustomMayaRenderer | 2510c8e1721a7d13545ec65f671260f3de125ff0 | [
"MIT"
] | 2 | 2019-11-13T18:56:02.000Z | 2020-03-18T02:50:40.000Z | import maya.OpenMaya as om
import maya.cmds as mc
import maya.mel as mel
import pymel.core as pm
def createGlobalsNode():
if mc.objExists("customMayaRendererGlobalsNode"):
return
mc.createNode(
"customMayaRendererGlobalsNode",
name = "customMayaRendererGlobalsNode",
shared = Tr... | 36.191358 | 109 | 0.555347 | import maya.OpenMaya as om
import maya.cmds as mc
import maya.mel as mel
import pymel.core as pm
def createGlobalsNode():
if mc.objExists("customMayaRendererGlobalsNode"):
return
mc.createNode(
"customMayaRendererGlobalsNode",
name = "customMayaRendererGlobalsNode",
shared = Tr... | true | true |
f772c3810ebe436f8cfb3fd4915083f1fec8d24d | 2,721 | py | Python | run.py | Ckst123/KoBERT-events | 68eb22845b179bcaf13771fea776be3d9772306f | [
"Apache-2.0"
] | null | null | null | run.py | Ckst123/KoBERT-events | 68eb22845b179bcaf13771fea776be3d9772306f | [
"Apache-2.0"
] | null | null | null | run.py | Ckst123/KoBERT-events | 68eb22845b179bcaf13771fea776be3d9772306f | [
"Apache-2.0"
] | null | null | null | from data_loader import load_data, tokenizer
from models import BertForMultipleSequenceClassification
from transformers import AutoConfig
import torch
from tqdm.auto import tqdm
from transformers import get_scheduler
from transformers import AdamW
from sklearn.metrics import accuracy_score, f1_score
label_list = ['확진... | 30.233333 | 100 | 0.646454 | from data_loader import load_data, tokenizer
from models import BertForMultipleSequenceClassification
from transformers import AutoConfig
import torch
from tqdm.auto import tqdm
from transformers import get_scheduler
from transformers import AdamW
from sklearn.metrics import accuracy_score, f1_score
label_list = ['확진... | true | true |
f772c3e4c5ee78c3bb515382ee0d3608bbb2c4ba | 5,344 | py | Python | ons.py | ChrisThoung/economic-data | 24749c3d5c8a0e79baa079ebd8a8a3868fe274f0 | [
"MIT"
] | null | null | null | ons.py | ChrisThoung/economic-data | 24749c3d5c8a0e79baa079ebd8a8a3868fe274f0 | [
"MIT"
] | null | null | null | ons.py | ChrisThoung/economic-data | 24749c3d5c8a0e79baa079ebd8a8a3868fe274f0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ons
===
UK Office for National Statistics (ONS) data file readers.
-------------------------------------------------------------------------------
MIT License
Copyright (c) 2018-21 Chris Thoung
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software a... | 32 | 102 | 0.625 |
__version__ = '0.3.2'
import csv
import io
import itertools
class CSV:
__slots__ = ['_buffer', '_metadata', '_stream']
CODE = 'CDID'
FIELDS = ['Title', 'PreUnit', 'Unit', 'Release Date', 'Next release', 'Important Notes']
def __init__(self, path_or_buffer):
self._stream = None
i... | true | true |
f772c49e2d65c8bb282197ffd1a01580201a1e72 | 530 | py | Python | backend/src/app.py | zonradkuse/city-tour-recsys | 46e9d7726a58fb5bfb1585393e0564dcc6ef69df | [
"MIT"
] | null | null | null | backend/src/app.py | zonradkuse/city-tour-recsys | 46e9d7726a58fb5bfb1585393e0564dcc6ef69df | [
"MIT"
] | null | null | null | backend/src/app.py | zonradkuse/city-tour-recsys | 46e9d7726a58fb5bfb1585393e0564dcc6ef69df | [
"MIT"
] | null | null | null | #src/app.py
from flask import Flask
from .config import app_config
from .models import db, bcrypt
from .models import UserModel, ReviewModel, NodeModel,AmenityModel,TourismModel,ShopModel
def create_app(env_name):
"""
Create app
"""
# app initiliazation
app = Flask(__name__)
app.config.from_object(app_... | 16.5625 | 89 | 0.69434 |
from flask import Flask
from .config import app_config
from .models import db, bcrypt
from .models import UserModel, ReviewModel, NodeModel,AmenityModel,TourismModel,ShopModel
def create_app(env_name):
app = Flask(__name__)
app.config.from_object(app_config[env_name])
bcrypt.init_app(app)
db.init_app... | true | true |
f772c5473001124ff7e453512529fec4f90ea327 | 1,138 | py | Python | app/modules/auth/use_cases/jwt_service.py | Bloodielie/todo-backend | 8485f91cd46c8e0f35a1c329427d4d37fab0781b | [
"MIT"
] | null | null | null | app/modules/auth/use_cases/jwt_service.py | Bloodielie/todo-backend | 8485f91cd46c8e0f35a1c329427d4d37fab0781b | [
"MIT"
] | null | null | null | app/modules/auth/use_cases/jwt_service.py | Bloodielie/todo-backend | 8485f91cd46c8e0f35a1c329427d4d37fab0781b | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from typing import Dict, Any, Optional
from jose import jwt, JWTError
from app.config import JWT_TOKEN_EXPIRE_MINUTES, SECRET_KEY, JWT_ALGORITHM
from app.modules.auth.use_cases.interfaces import IJwtService
def _added_exp_to_data(data: Dict[str, Any], minutes: int) -> Dict[s... | 36.709677 | 77 | 0.724077 | from datetime import datetime, timedelta
from typing import Dict, Any, Optional
from jose import jwt, JWTError
from app.config import JWT_TOKEN_EXPIRE_MINUTES, SECRET_KEY, JWT_ALGORITHM
from app.modules.auth.use_cases.interfaces import IJwtService
def _added_exp_to_data(data: Dict[str, Any], minutes: int) -> Dict[s... | true | true |
f772c595b97f6bbe042967570d9cabd4e9e1e40f | 6,172 | py | Python | test/test_plugin.py | fungaegis/pytest-custom-scheduling | 7255c9f8d7423f6b05f021e3038afad6fd9b8a2f | [
"MIT"
] | 1 | 2021-05-18T12:07:23.000Z | 2021-05-18T12:07:23.000Z | test/test_plugin.py | fungaegis/pytest-custom-scheduling | 7255c9f8d7423f6b05f021e3038afad6fd9b8a2f | [
"MIT"
] | null | null | null | test/test_plugin.py | fungaegis/pytest-custom-scheduling | 7255c9f8d7423f6b05f021e3038afad6fd9b8a2f | [
"MIT"
] | null | null | null | import pytest
def test_help(testdir):
testdir.makepyfile(
"""
def test_01():
a = "pytest"
b = "py"
assert a == b
"""
)
result = testdir.runpytest("--help")
result.stdout.fnmatch_lines(["*--switch*"])
result.stdout.fnmatch_lines(["*Custom ... | 30.254902 | 104 | 0.461439 | import pytest
def test_help(testdir):
testdir.makepyfile(
"""
def test_01():
a = "pytest"
b = "py"
assert a == b
"""
)
result = testdir.runpytest("--help")
result.stdout.fnmatch_lines(["*--switch*"])
result.stdout.fnmatch_lines(["*Custom ... | true | true |
f772c5e68a6943aa84bd3d3bf22f3c7eaa53514a | 12,549 | py | Python | gailtf/baselines/ppo1/pposgd_simple.py | liytt85/gail-tf-pro | b5d9e25400b91a60ce9f8aacccaaec4c4af4e453 | [
"MIT"
] | 201 | 2017-10-17T16:36:05.000Z | 2022-02-18T11:15:49.000Z | gailtf/baselines/ppo1/pposgd_simple.py | inverse-reinforement-learning/gail-tf | ad92f41c26c34e8fabc536664fb11b44f25956cf | [
"MIT"
] | 20 | 2017-10-18T11:43:26.000Z | 2020-07-09T03:35:14.000Z | gailtf/baselines/ppo1/pposgd_simple.py | inverse-reinforement-learning/gail-tf | ad92f41c26c34e8fabc536664fb11b44f25956cf | [
"MIT"
] | 60 | 2017-10-17T19:04:21.000Z | 2021-05-29T12:39:58.000Z | from gailtf.baselines.common import Dataset, explained_variance, fmt_row, zipsame
from gailtf.baselines import logger
import gailtf.baselines.common.tf_util as U
import tensorflow as tf, numpy as np
import time, os, sys
from gailtf.baselines.common.mpi_adam import MpiAdam
from gailtf.baselines.common.mpi_moments import... | 42.39527 | 123 | 0.626345 | from gailtf.baselines.common import Dataset, explained_variance, fmt_row, zipsame
from gailtf.baselines import logger
import gailtf.baselines.common.tf_util as U
import tensorflow as tf, numpy as np
import time, os, sys
from gailtf.baselines.common.mpi_adam import MpiAdam
from gailtf.baselines.common.mpi_moments import... | true | true |
f772c6fc93dc9963fa9d653a0acec5067d10860a | 460 | py | Python | ex086 - Matriz em python.py | marvincosmo/Python-Curso-em-Video | 47ee3dd6423835e7bca159ffd7ee796423569176 | [
"MIT"
] | null | null | null | ex086 - Matriz em python.py | marvincosmo/Python-Curso-em-Video | 47ee3dd6423835e7bca159ffd7ee796423569176 | [
"MIT"
] | null | null | null | ex086 - Matriz em python.py | marvincosmo/Python-Curso-em-Video | 47ee3dd6423835e7bca159ffd7ee796423569176 | [
"MIT"
] | null | null | null | """ 86 - Crie um programa que declare uma matriz de dimensão 3×3 e preencha com valores lidos pelo teclado. No final,
mostre a matriz na tela, com a formatação correta. """
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for l in range(0, 3):
for c in range(0, 3):
matriz[l][c] = int(input(f'Digite um valor para... | 35.384615 | 117 | 0.569565 |
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for l in range(0, 3):
for c in range(0, 3):
matriz[l][c] = int(input(f'Digite um valor para [{l}, {c}]: '))
print('-=' * 30)
for l in range(0, 3):
for c in range(0, 3):
print(f'[{matriz[l][c]:^5}]', end='')
print()
| true | true |
f772c715c784ec188873fc4e8436e3bfae64ba13 | 3,514 | py | Python | experiments/chat/turbotutorial/settings.py | hotwire-django/turbo-django | a8eab649f7f09f89e7cbedd72582b2ffe81abcab | [
"MIT"
] | 298 | 2020-12-23T21:28:46.000Z | 2022-03-19T11:25:23.000Z | experiments/chat/turbotutorial/settings.py | hotwire-django/turbo-django | a8eab649f7f09f89e7cbedd72582b2ffe81abcab | [
"MIT"
] | 30 | 2020-12-26T14:57:40.000Z | 2022-03-28T12:44:34.000Z | experiments/chat/turbotutorial/settings.py | hotwire-django/turbo-django | a8eab649f7f09f89e7cbedd72582b2ffe81abcab | [
"MIT"
] | 11 | 2020-12-24T19:50:40.000Z | 2022-01-23T15:02:58.000Z | """
Django settings for turbotutorial project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from p... | 27.888889 | 98 | 0.715709 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-k-zmgkm*7x_-&&s=g87(2dxw%l=v$s@py28sw88m@qm#it*y=q'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.co... | true | true |
f772c7a3d9643aa8d050f3dd0be7c8449f4eae8c | 876 | py | Python | mmpose/models/backbones/__init__.py | SummerVideoAnalysis/mmpose | 70d60e03b7eaa0ae1ec66cc7a22c00916f00c9e1 | [
"Apache-2.0"
] | 1 | 2022-01-11T09:31:53.000Z | 2022-01-11T09:31:53.000Z | mmpose/models/backbones/__init__.py | SummerVideoAnalysis/mmpose | 70d60e03b7eaa0ae1ec66cc7a22c00916f00c9e1 | [
"Apache-2.0"
] | null | null | null | mmpose/models/backbones/__init__.py | SummerVideoAnalysis/mmpose | 70d60e03b7eaa0ae1ec66cc7a22c00916f00c9e1 | [
"Apache-2.0"
] | null | null | null | from .alexnet import AlexNet
from .cpm import CPM
from .hourglass import HourglassNet
from .hrnet import HRNet
from .mobilenet_v2 import MobileNetV2
from .mobilenet_v3 import MobileNetV3
from .mspn import MSPN
from .regnet import RegNet
from .resnest import ResNeSt
from .resnet import ResNet, ResNetV1d
from .resnext im... | 31.285714 | 79 | 0.761416 | from .alexnet import AlexNet
from .cpm import CPM
from .hourglass import HourglassNet
from .hrnet import HRNet
from .mobilenet_v2 import MobileNetV2
from .mobilenet_v3 import MobileNetV3
from .mspn import MSPN
from .regnet import RegNet
from .resnest import ResNeSt
from .resnet import ResNet, ResNetV1d
from .resnext im... | true | true |
f772c7f2619c36016e4728e3e4fdcd432a8f195b | 1,140 | py | Python | problems/test_0773.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | 1 | 2017-06-17T23:47:17.000Z | 2017-06-17T23:47:17.000Z | problems/test_0773.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | problems/test_0773.py | chrisxue815/leetcode_python | dec3c160d411a5c19dc8e9d96e7843f0e4c36820 | [
"Unlicense"
] | null | null | null | import collections
import unittest
from typing import List
import utils
target = (1, 2, 3, 4, 5, 0)
swaps = [
[1, 3],
[0, 2, 4],
[1, 5],
[0, 4],
[1, 3, 5],
[2, 4],
]
# BFS, shortest path.
class Solution:
def slidingPuzzle(self, board: List[List[int]]) -> int:
cur = tuple(cell fo... | 21.509434 | 71 | 0.514035 | import collections
import unittest
from typing import List
import utils
target = (1, 2, 3, 4, 5, 0)
swaps = [
[1, 3],
[0, 2, 4],
[1, 5],
[0, 4],
[1, 3, 5],
[2, 4],
]
class Solution:
def slidingPuzzle(self, board: List[List[int]]) -> int:
cur = tuple(cell for row in board for cel... | true | true |
f772c7f597172bcdf8940dddfccd3c41e75e8da2 | 97 | py | Python | prettyresults/__init__.py | anarthal/prettyresults | 4dfa505b7744961301339a13cd459e513e4b4316 | [
"MIT"
] | null | null | null | prettyresults/__init__.py | anarthal/prettyresults | 4dfa505b7744961301339a13cd459e513e4b4316 | [
"MIT"
] | null | null | null | prettyresults/__init__.py | anarthal/prettyresults | 4dfa505b7744961301339a13cd459e513e4b4316 | [
"MIT"
] | null | null | null | from .result_tree import ResultTree
from .utils import VarType
from .dataloader import DataLoader | 32.333333 | 35 | 0.85567 | from .result_tree import ResultTree
from .utils import VarType
from .dataloader import DataLoader | true | true |
f772c8dd9c2ca7c36715b7af970787937c73dd16 | 1,593 | py | Python | allennlp/training/metrics/entropy.py | tianjianjiang/allennlp | 0839f5c263911ec5ff04a2ebe575493c7e0436ef | [
"Apache-2.0"
] | 2 | 2019-12-03T20:04:56.000Z | 2021-03-29T10:38:06.000Z | allennlp/training/metrics/entropy.py | dasguptar/allennlp | 35b285585e0677b1025eac1c19b5eefe7e2a70db | [
"Apache-2.0"
] | null | null | null | allennlp/training/metrics/entropy.py | dasguptar/allennlp | 35b285585e0677b1025eac1c19b5eefe7e2a70db | [
"Apache-2.0"
] | 2 | 2019-12-04T16:55:13.000Z | 2019-12-06T18:47:15.000Z | from typing import Optional
from overrides import overrides
import torch
from allennlp.training.metrics.metric import Metric
@Metric.register("entropy")
class Entropy(Metric):
def __init__(self) -> None:
self._entropy = 0.0
self._count = 0
@overrides
def __call__(
self, # type:... | 27.465517 | 95 | 0.586943 | from typing import Optional
from overrides import overrides
import torch
from allennlp.training.metrics.metric import Metric
@Metric.register("entropy")
class Entropy(Metric):
def __init__(self) -> None:
self._entropy = 0.0
self._count = 0
@overrides
def __call__(
self, ... | true | true |
f772caf8e7a6ddb9f28631b5fe872acfa14c6087 | 26,449 | py | Python | venv/Lib/site-packages/ebcli/controllers/create.py | theLambda/DBH-project1 | 9b7b1c9bd9f6629724c53872c60b1171e9ba1fa2 | [
"MIT"
] | 110 | 2020-01-15T22:58:46.000Z | 2022-03-27T20:47:33.000Z | ebcli/controllers/create.py | QPC-database/aws-elastic-beanstalk-cli | 87ad9d8bbe5e4e7cb01b1bd4392eda33cb1943f7 | [
"Apache-2.0"
] | 89 | 2020-01-15T23:18:34.000Z | 2022-03-31T21:56:05.000Z | ebcli/controllers/create.py | QPC-database/aws-elastic-beanstalk-cli | 87ad9d8bbe5e4e7cb01b1bd4392eda33cb1943f7 | [
"Apache-2.0"
] | 50 | 2020-01-15T22:58:53.000Z | 2022-02-11T17:39:28.000Z | # Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 41.586478 | 118 | 0.636924 | import argparse
import os
import time
from ebcli.core import io, fileoperations, hooks
from ebcli.core.abstractcontroller import AbstractBaseController
from ebcli.lib import elasticbeanstalk, utils
from ebcli.objects.exceptions import (
AlreadyExistsError,
InvalidOptionsError,
RetiredPlatformBranchError,
... | true | true |
f772cc1924c2f9ce3367d1bd42e39202b874cb21 | 67 | py | Python | tests/__init__.py | polyswarm/polyswarmd-config | 3cf28f0b71cbe86d88696485981d395043cc3dce | [
"MIT"
] | null | null | null | tests/__init__.py | polyswarm/polyswarmd-config | 3cf28f0b71cbe86d88696485981d395043cc3dce | [
"MIT"
] | 5 | 2020-02-11T14:06:49.000Z | 2020-08-07T16:27:31.000Z | tests/__init__.py | polyswarm/polyswarmd-config | 3cf28f0b71cbe86d88696485981d395043cc3dce | [
"MIT"
] | 1 | 2021-04-26T10:58:57.000Z | 2021-04-26T10:58:57.000Z | from .config import Test, TestArtifactServiceClient, SubConfigTest
| 33.5 | 66 | 0.865672 | from .config import Test, TestArtifactServiceClient, SubConfigTest
| true | true |
f772cc8be515558296022a844b5aa39a34b8211a | 34,458 | py | Python | tests/hwsim/test_p2p_autogo.py | gxk/hostap | af8bc24da37c340e17417317d7d97f1ea2ef0dc3 | [
"Unlicense"
] | null | null | null | tests/hwsim/test_p2p_autogo.py | gxk/hostap | af8bc24da37c340e17417317d7d97f1ea2ef0dc3 | [
"Unlicense"
] | null | null | null | tests/hwsim/test_p2p_autogo.py | gxk/hostap | af8bc24da37c340e17417317d7d97f1ea2ef0dc3 | [
"Unlicense"
] | null | null | null | # P2P autonomous GO test cases
# Copyright (c) 2013-2015, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import time
import subprocess
import logging
logger = logging.getLogger()
import hwsim_util... | 40.491187 | 175 | 0.65442 |
from remotehost import remote_compatible
import time
import subprocess
import logging
logger = logging.getLogger()
import hwsim_utils
import utils
from utils import HwsimSkip
from wlantest import Wlantest
from wpasupplicant import WpaSupplicant
from p2p_utils import *
from test_p2p_messages import mgmt_tx, parse_p2p_... | true | true |
f772cddfbdf6e936c9802bb6f461537e52f4c724 | 736 | py | Python | src/demo_quipuswap/types/fa2_token/storage.py | r4ravi2008/dipdup-py | 1be3c3ac705f687af058ff51cde7970878584562 | [
"MIT"
] | null | null | null | src/demo_quipuswap/types/fa2_token/storage.py | r4ravi2008/dipdup-py | 1be3c3ac705f687af058ff51cde7970878584562 | [
"MIT"
] | null | null | null | src/demo_quipuswap/types/fa2_token/storage.py | r4ravi2008/dipdup-py | 1be3c3ac705f687af058ff51cde7970878584562 | [
"MIT"
] | null | null | null | # generated by datamodel-codegen:
# filename: storage.json
from __future__ import annotations
from typing import Any, Dict, List
from pydantic import BaseModel
class Key(BaseModel):
address: str
nat: str
class LedgerItem(BaseModel):
key: Key
value: str
class Key1(BaseModel):
operator: st... | 16.355556 | 44 | 0.697011 |
from __future__ import annotations
from typing import Any, Dict, List
from pydantic import BaseModel
class Key(BaseModel):
address: str
nat: str
class LedgerItem(BaseModel):
key: Key
value: str
class Key1(BaseModel):
operator: str
owner: str
token_id: str
class Operator(BaseModel)... | true | true |
f772ceacb9598b06a119032dfbbcdcaadbe79a31 | 26,254 | py | Python | gibson2/core/physics/drivers/minitaur.py | y-veys/iGibson | 1442c50187f8fcef118b097c195fef707eef04cb | [
"MIT"
] | 2 | 2020-10-29T02:21:27.000Z | 2021-07-26T07:38:23.000Z | gibson2/core/physics/drivers/minitaur.py | y-veys/iGibson | 1442c50187f8fcef118b097c195fef707eef04cb | [
"MIT"
] | null | null | null | gibson2/core/physics/drivers/minitaur.py | y-veys/iGibson | 1442c50187f8fcef118b097c195fef707eef04cb | [
"MIT"
] | null | null | null | """This file implements the functionalities of a minitaur using pybullet.
"""
import copy
import math
import numpy as np
from gibson2.core.physics.drivers import motor
from gibson2.core.physics.robot_locomotors import LocomotorRobot
from gibson2.core.physics.robot_bases import Joint, BodyPart
import os, sys
import pyb... | 44.878632 | 132 | 0.574617 | import copy
import math
import numpy as np
from gibson2.core.physics.drivers import motor
from gibson2.core.physics.robot_locomotors import LocomotorRobot
from gibson2.core.physics.robot_bases import Joint, BodyPart
import os, sys
import pybullet as p
import gym
from transforms3d.euler import euler2quat
tracking_camer... | true | true |
f772cfd1c2f15a96be6efd11c7021e6cbcb81eb6 | 914 | py | Python | programs/urls.py | simonwoerpel/parteien.medienrevolte.de | 6890a3a5769b42992e558753d5c681071d00af40 | [
"MIT"
] | 1 | 2020-02-08T00:32:20.000Z | 2020-02-08T00:32:20.000Z | programs/urls.py | simonwoerpel/parteien.medienrevolte.de | 6890a3a5769b42992e558753d5c681071d00af40 | [
"MIT"
] | null | null | null | programs/urls.py | simonwoerpel/parteien.medienrevolte.de | 6890a3a5769b42992e558753d5c681071d00af40 | [
"MIT"
] | null | null | null | """programs URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 35.153846 | 80 | 0.718818 | from django.conf.urls import url, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^', include('app.urls'))
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
| true | true |
f772d071c93ed54141c6275fbf554c997f30c1bf | 1,718 | py | Python | scripts/add-shell-server.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 280 | 2016-03-23T05:16:07.000Z | 2022-03-25T10:45:33.000Z | scripts/add-shell-server.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 384 | 2016-03-22T05:14:47.000Z | 2021-09-13T23:46:14.000Z | scripts/add-shell-server.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 142 | 2016-03-15T16:27:21.000Z | 2022-02-23T23:41:28.000Z | #!/usr/bin/env python3
"""
./add-shell-server.py
Adds a shell server to the website.
"""
import api
import argparse
import os
import sys
def main(args):
# If a server by this name exists short circuit no action necessary
servers = api.shell_servers.get_all_servers()
for s in servers:
if s["name... | 28.633333 | 107 | 0.623399 |
import api
import argparse
import os
import sys
def main(args):
servers = api.shell_servers.get_all_servers()
for s in servers:
if s["name"] == args.name:
print("WARN: shell server already exists, not modified: {}".format(args.name), file=sys.stderr)
print(s["sid"], end="... | true | true |
f772d0a70a9e3e71c7863a2e72b2b50a1cea5d9f | 13,042 | py | Python | main.py | YuJungHeo/kbvqa-public | c04bed5c60085ac3a551a8c196e6269befce1e5b | [
"MIT"
] | null | null | null | main.py | YuJungHeo/kbvqa-public | c04bed5c60085ac3a551a8c196e6269befce1e5b | [
"MIT"
] | null | null | null | main.py | YuJungHeo/kbvqa-public | c04bed5c60085ac3a551a8c196e6269befce1e5b | [
"MIT"
] | null | null | null | import os
import time
import torch
import argparse
from tqdm import tqdm
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from utils import (
load_files,
save_pickle,
fix_seed,
print_model,
CosineAnn... | 35.248649 | 103 | 0.552063 | import os
import time
import torch
import argparse
from tqdm import tqdm
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from utils import (
load_files,
save_pickle,
fix_seed,
print_model,
CosineAnn... | true | true |
f772d0ca8bcc5629f3c5c09d9ee9fd412949adb9 | 2,931 | py | Python | demo/pach_solve.py | Zanderzt/TensorRT_Mask_RCNN | df799e7ac7392b557a834ced92d0cb9b84d24df9 | [
"MIT"
] | 8 | 2020-06-19T00:23:51.000Z | 2022-03-27T16:49:18.000Z | demo/pach_solve.py | Zanderzt/TensorRT_Mask_RCNN | df799e7ac7392b557a834ced92d0cb9b84d24df9 | [
"MIT"
] | 2 | 2020-06-20T03:29:29.000Z | 2022-01-21T21:24:43.000Z | demo/pach_solve.py | Zanderzt/TensorRT_Mask_RCNN | df799e7ac7392b557a834ced92d0cb9b84d24df9 | [
"MIT"
] | 5 | 2019-12-28T05:34:12.000Z | 2021-08-31T05:51:53.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import argparse
import cv2
import os
from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
from timeit import default_timer as timer
import time
def main():
parser = argparse.ArgumentParser(description="PyTorch Object Detec... | 30.216495 | 88 | 0.605254 | import argparse
import cv2
import os
from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
from timeit import default_timer as timer
import time
def main():
parser = argparse.ArgumentParser(description="PyTorch Object Detection Webcam Demo")
parser.add_argument(
"--config-file",
... | true | true |
f772d0da78a23972af58f24dff8f4ba7bf929870 | 3,414 | py | Python | application/pages/ngl_molecule_viewer.py | nickk/awesome-panel | df184c4ddfea74acb74b2af2e7a767a83522cc83 | [
"Apache-2.0"
] | 179 | 2019-12-04T14:54:53.000Z | 2022-03-30T09:08:38.000Z | application/pages/ngl_molecule_viewer.py | nickk/awesome-panel | df184c4ddfea74acb74b2af2e7a767a83522cc83 | [
"Apache-2.0"
] | 62 | 2019-12-14T16:51:28.000Z | 2022-03-19T18:47:12.000Z | application/pages/ngl_molecule_viewer.py | nickk/awesome-panel | df184c4ddfea74acb74b2af2e7a767a83522cc83 | [
"Apache-2.0"
] | 35 | 2019-12-08T13:19:53.000Z | 2022-03-25T10:33:02.000Z | """
This is an example of a Protein viewer app, using the [NGL Viewer]\
(https://github.com/nglviewer/ngl).
You can import it from the `awesome-panel-extensions` package via
`from awesome_panel_extensions.widgets.ngl_viewer import NGLViewer`.
The NGL Viewer was developed with help from the community. Checkout ... | 35.936842 | 100 | 0.638254 |
import panel as pn
import param
from awesome_panel_extensions.site import site
from awesome_panel_extensions.widgets.ngl_viewer import NGLViewer
from panel.template import FastListTemplate
APPLICATION = site.create_application(
url="ngl-molecule-viewer",
name="NGL Molecule Viewer",
author="Joche... | true | true |
f772d1a6f2b6a13d5414242ac029770d140bd85f | 8,596 | py | Python | baselines/run.py | zfar-/BaselineWithNoise | ca18d1f2aed36d571c50ed8e630eb38a87c79265 | [
"MIT"
] | null | null | null | baselines/run.py | zfar-/BaselineWithNoise | ca18d1f2aed36d571c50ed8e630eb38a87c79265 | [
"MIT"
] | null | null | null | baselines/run.py | zfar-/BaselineWithNoise | ca18d1f2aed36d571c50ed8e630eb38a87c79265 | [
"MIT"
] | null | null | null | import sys
import multiprocessing
import os.path as osp
import gym
from collections import defaultdict
import tensorflow as tf
import numpy as np
from baselines.common.vec_env.vec_video_recorder import VecVideoRecorder
from baselines.common.vec_env.vec_frame_stack import VecFrameStack
from baselines.common.cmd_util im... | 31.372263 | 185 | 0.638902 | import sys
import multiprocessing
import os.path as osp
import gym
from collections import defaultdict
import tensorflow as tf
import numpy as np
from baselines.common.vec_env.vec_video_recorder import VecVideoRecorder
from baselines.common.vec_env.vec_frame_stack import VecFrameStack
from baselines.common.cmd_util im... | true | true |
f772d26f030bb3694d3554da27dcde0138b754e8 | 1,260 | py | Python | Ninja/Leetcode/63_Unique_Paths_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/Leetcode/63_Unique_Paths_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/Leetcode/63_Unique_Paths_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | """
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respectively in the grid.
For example,
There is one obstacle in the middle of a 3x3 grid as illustrated below.
[
[0,0,0],
[0,1,0],
[0,... | 26.808511 | 92 | 0.512698 |
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid):
if obstacleGrid[0][0] == 1:
return 0
M = len(obstacleGrid)
N = len(obstacleGrid[0])
dp = [ [0 for j in range(N)] for i in range(M) ]
for i in range(M):
for j in range(N):
... | true | true |
f772d29a4293a4ec9e1e247e802b597303bd7337 | 611 | py | Python | lesson6_pyeapi/ex2b.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | lesson6_pyeapi/ex2b.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | lesson6_pyeapi/ex2b.py | anejolazaro70/python_july19 | d4fd2f0d00d22f2f103ef9fe9c289c8b0651b454 | [
"Apache-2.0"
] | null | null | null | import pyeapi
from getpass import getpass
from my_funcs import function1, function2
from pprint import pprint
def main():
all_table = list()
hosts = function1('ex2b.yml')
for host in hosts:
print("Connecting to...", host.get('host'))
connection = pyeapi.client.connect(**host, password=getpa... | 29.095238 | 70 | 0.644845 | import pyeapi
from getpass import getpass
from my_funcs import function1, function2
from pprint import pprint
def main():
all_table = list()
hosts = function1('ex2b.yml')
for host in hosts:
print("Connecting to...", host.get('host'))
connection = pyeapi.client.connect(**host, password=getpa... | true | true |
f772d2a76137307690bdd09ff4f3d88680ad7346 | 387 | py | Python | pyFact/wsgi.py | kaajavi/facture | 42ef360e76424c81280218f57b5737c01cf8fb4e | [
"Apache-2.0"
] | null | null | null | pyFact/wsgi.py | kaajavi/facture | 42ef360e76424c81280218f57b5737c01cf8fb4e | [
"Apache-2.0"
] | null | null | null | pyFact/wsgi.py | kaajavi/facture | 42ef360e76424c81280218f57b5737c01cf8fb4e | [
"Apache-2.0"
] | null | null | null | """
WSGI config for pyFact project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pyFact.settings")
from django.core.wsg... | 25.8 | 78 | 0.788114 |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pyFact.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| true | true |
f772d304cd1946d71e488581d3fe95271c6002cc | 29,362 | py | Python | moto/kinesis/models.py | pll/moto | e49e67aba5d108b03865bdb42124206ea7e572ea | [
"Apache-2.0"
] | null | null | null | moto/kinesis/models.py | pll/moto | e49e67aba5d108b03865bdb42124206ea7e572ea | [
"Apache-2.0"
] | null | null | null | moto/kinesis/models.py | pll/moto | e49e67aba5d108b03865bdb42124206ea7e572ea | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
import datetime
import re
import itertools
from operator import attrgetter
from hashlib import md5
from moto.core import BaseBackend, BaseModel, CloudFormationModel
from moto.core.utils import unix_time, BackendDict
from moto.core import get_account_id
from moto.utilities.paginator... | 36.748436 | 329 | 0.636162 | from collections import OrderedDict
import datetime
import re
import itertools
from operator import attrgetter
from hashlib import md5
from moto.core import BaseBackend, BaseModel, CloudFormationModel
from moto.core.utils import unix_time, BackendDict
from moto.core import get_account_id
from moto.utilities.paginator... | true | true |
f772d4682b7637c7802a4e3be5db05ccd14bf49e | 18,110 | py | Python | fairseq/tasks/translation.py | 99starman/fairseq | a098a52f5c961dffd06fd9a14c4cf6b657f2f52d | [
"MIT"
] | null | null | null | fairseq/tasks/translation.py | 99starman/fairseq | a098a52f5c961dffd06fd9a14c4cf6b657f2f52d | [
"MIT"
] | null | null | null | fairseq/tasks/translation.py | 99starman/fairseq | a098a52f5c961dffd06fd9a14c4cf6b657f2f52d | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from dataclasses import dataclass, field
import itertools
import json
import logging
import os
from typing import Optional
from argparse impor... | 35.861386 | 108 | 0.60011 |
from dataclasses import dataclass, field
import itertools
import json
import logging
import os
from typing import Optional
from argparse import Namespace
from omegaconf import II
import numpy as np
from fairseq import metrics, utils
from fairseq.data import (
AppendTokenDataset,
ConcatDataset,
LanguagePai... | true | true |
f772d589d7888f8ca9ed7bc32533dbb86d3631a8 | 134 | py | Python | hoomd/metal/_metal.py | PetersResearchGroup/PCND | 584768cc683a6df0152ead69b567d05b781aab2b | [
"BSD-3-Clause"
] | 2 | 2020-03-30T14:38:50.000Z | 2020-06-02T05:53:41.000Z | hoomd/metal/_metal.py | PetersResearchGroup/PCND | 584768cc683a6df0152ead69b567d05b781aab2b | [
"BSD-3-Clause"
] | null | null | null | hoomd/metal/_metal.py | PetersResearchGroup/PCND | 584768cc683a6df0152ead69b567d05b781aab2b | [
"BSD-3-Clause"
] | 1 | 2020-05-20T07:00:08.000Z | 2020-05-20T07:00:08.000Z | # This file exists to allow the hoomd module to import from the source checkout dir
# for use when building the sphinx documentation.
| 44.666667 | 83 | 0.798507 | true | true | |
f772d5e4170417f5d7c19e3157a03730b1e989ed | 293 | py | Python | ind3.py | eztwokey/l4 | b3eff91b5dfd4694a73180109b07f507a64b3a6d | [
"MIT"
] | null | null | null | ind3.py | eztwokey/l4 | b3eff91b5dfd4694a73180109b07f507a64b3a6d | [
"MIT"
] | null | null | null | ind3.py | eztwokey/l4 | b3eff91b5dfd4694a73180109b07f507a64b3a6d | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
# Одноклеточная амеба каждые три часа делится на 2 клетки. Определить, сколько будет клеток через 6 часов.
f = 1
n = int(input('Введите кол-во часов'))
u = n // 3
f = f * u
print(f)
| 24.416667 | 110 | 0.610922 | import sys
if __name__ == '__main__':
f = 1
n = int(input('Введите кол-во часов'))
u = n // 3
f = f * u
print(f)
| true | true |
f772d5eca121e21a10a65d29b4906e47b188d4b1 | 2,045 | py | Python | game/game.py | fietensen/FlappyAI | f8bff24e2ee62edf97a9b061183e28bf4924db09 | [
"MIT"
] | null | null | null | game/game.py | fietensen/FlappyAI | f8bff24e2ee62edf97a9b061183e28bf4924db09 | [
"MIT"
] | null | null | null | game/game.py | fietensen/FlappyAI | f8bff24e2ee62edf97a9b061183e28bf4924db09 | [
"MIT"
] | null | null | null | from game.pole import PolesObject
from game.agent import Agent
from pygame import Rect
import pygame, struct
import numpy as np
class Game:
def __init__(self, resolution):
self.resolution = resolution
self.screen = pygame.display.set_mode(resolution) # init window
self.playerpos = (0, resol... | 38.584906 | 104 | 0.58044 | from game.pole import PolesObject
from game.agent import Agent
from pygame import Rect
import pygame, struct
import numpy as np
class Game:
def __init__(self, resolution):
self.resolution = resolution
self.screen = pygame.display.set_mode(resolution) self.playerpos = (0, resolution[1]) ... | true | true |
f772d80d868a833b31ba193dc183c24a8cde4854 | 156,520 | py | Python | nutils/evaluable.py | soraros/nutils | 91119b12bdebf12a85eecb6a2247be2415f60e6f | [
"MIT"
] | 1 | 2019-11-17T23:16:13.000Z | 2019-11-17T23:16:13.000Z | nutils/evaluable.py | soraros/nutils | 91119b12bdebf12a85eecb6a2247be2415f60e6f | [
"MIT"
] | 1 | 2020-12-23T22:38:16.000Z | 2020-12-23T22:38:16.000Z | nutils/evaluable.py | soraros/nutils | 91119b12bdebf12a85eecb6a2247be2415f60e6f | [
"MIT"
] | null | null | null | # Copyright (c) 2014 Evalf
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, s... | 35.435816 | 225 | 0.67293 |
import typing
if typing.TYPE_CHECKING:
from typing_extensions import Protocol
else:
Protocol = object
from . import debug_flags, util, types, numeric, cache, warnings, parallel, sparse
from ._graph import Node, RegularNode, DuplicatedLeafNode, InvisibleNode, Subgraph
import numpy, sys, itertools, functools, oper... | true | true |
f772d920af00598d1102baa1677133d66fc776bc | 17,013 | py | Python | services/core/MasterDriverAgent/master_driver/driver.py | rmay-intwine/volttron | a449f70e32f73ff0136a838d0feddb928ede6298 | [
"Apache-2.0"
] | 1 | 2017-04-18T23:57:20.000Z | 2017-04-18T23:57:20.000Z | services/core/MasterDriverAgent/master_driver/driver.py | rmay-intwine/volttron | a449f70e32f73ff0136a838d0feddb928ede6298 | [
"Apache-2.0"
] | null | null | null | services/core/MasterDriverAgent/master_driver/driver.py | rmay-intwine/volttron | a449f70e32f73ff0136a838d0feddb928ede6298 | [
"Apache-2.0"
] | 1 | 2019-04-04T17:13:46.000Z | 2019-04-04T17:13:46.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2017, Battelle Memorial Institute.
#
# 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... | 41.698529 | 122 | 0.608829 |
from volttron.platform.vip.agent import BasicAgent, Core
from volttron.platform.agent import utils
import logging
import random
import gevent
import traceback
from volttron.platform.messaging import headers as headers_mod
from volttron.platform.messaging.topics import (DRIVER_TOPIC_BASE,
... | true | true |
f772da6884b8c98f75bbc488d8a8476180f3b964 | 581 | py | Python | plugins/start.py | annihilatorrrr/CheckRestrictionsBot | c8876c87392cae51ba7015f357dc7a2ee79f619e | [
"MIT"
] | 4 | 2020-10-15T04:47:09.000Z | 2020-12-23T11:12:30.000Z | plugins/start.py | annihilatorrrr/CheckRestrictionsBot | c8876c87392cae51ba7015f357dc7a2ee79f619e | [
"MIT"
] | 1 | 2020-10-15T04:48:23.000Z | 2020-10-17T15:14:01.000Z | plugins/start.py | annihilatorrrr/CheckRestrictionsBot | c8876c87392cae51ba7015f357dc7a2ee79f619e | [
"MIT"
] | 7 | 2020-10-16T03:42:15.000Z | 2020-12-30T15:36:48.000Z | from pyrogram import Client, filters
from pyrogram.types import Message
from bot import Bot
@Bot.on_message(filters.command("start"))
async def start(c: Client, m: Message):
await c.send_message(
m.chat.id,
f"Hi {m.from_user.first_name}. I am an account info checker inspired by @SpEcHIDe ... | 38.733333 | 118 | 0.678141 | from pyrogram import Client, filters
from pyrogram.types import Message
from bot import Bot
@Bot.on_message(filters.command("start"))
async def start(c: Client, m: Message):
await c.send_message(
m.chat.id,
f"Hi {m.from_user.first_name}. I am an account info checker inspired by @SpEcHIDe ... | true | true |
f772dad1608d7c86f054c19ecf8f2842c84b9ce2 | 12,934 | py | Python | src/stub.py | chadmed/asahi-installer | f611af0e5d13fc4c87985a75583506b1b846c764 | [
"MIT"
] | null | null | null | src/stub.py | chadmed/asahi-installer | f611af0e5d13fc4c87985a75583506b1b846c764 | [
"MIT"
] | null | null | null | src/stub.py | chadmed/asahi-installer | f611af0e5d13fc4c87985a75583506b1b846c764 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
import os, os.path, plistlib, shutil, sys, stat, subprocess, urlcache, zipfile, logging, json
import osenum, firmware.wifi
from util import *
class StubInstaller(PackageInstaller):
def __init__(self, sysinfo, dutil, osinfo, ipsw_info):
super().__init__()
self.dutil = ... | 41.455128 | 105 | 0.608474 | import os, os.path, plistlib, shutil, sys, stat, subprocess, urlcache, zipfile, logging, json
import osenum, firmware.wifi
from util import *
class StubInstaller(PackageInstaller):
def __init__(self, sysinfo, dutil, osinfo, ipsw_info):
super().__init__()
self.dutil = dutil
self.sysinfo = sy... | true | true |
f772db269d64efcb85e9aacb039122505ba21daf | 1,815 | py | Python | files/.config/kitty/termpdf.py | apereiroc/fictional-couscous | 0f4cabfad1c477c0c881c74feaa5d12a41b8df1d | [
"MIT"
] | null | null | null | files/.config/kitty/termpdf.py | apereiroc/fictional-couscous | 0f4cabfad1c477c0c881c74feaa5d12a41b8df1d | [
"MIT"
] | null | null | null | files/.config/kitty/termpdf.py | apereiroc/fictional-couscous | 0f4cabfad1c477c0c881c74feaa5d12a41b8df1d | [
"MIT"
] | null | null | null | from kittens.tui.handler import result_handler
import os
def main(args):
pass
@result_handler(no_ui=True)
def handle_result(args, result, target_window_id, boss):
window_title = "termpdf"
termpdf_cmd = "termpdf.py"
cmd = termpdf_cmd + " " + os.path.expanduser(args[1])
# Runs a command in the window
def r... | 33.611111 | 79 | 0.70303 | from kittens.tui.handler import result_handler
import os
def main(args):
pass
@result_handler(no_ui=True)
def handle_result(args, result, target_window_id, boss):
window_title = "termpdf"
termpdf_cmd = "termpdf.py"
cmd = termpdf_cmd + " " + os.path.expanduser(args[1])
def run_cmd(window):
boss.child_... | true | true |
f772db815f9f60f80de9a979f128d02b4a36aa2c | 1,382 | py | Python | ees_sharepoint/connector_queue.py | elastic/enterprise-search-sharepoint-server-2016-connector | c205809a88efde8456b5d775a8233531bf870657 | [
"Apache-2.0"
] | null | null | null | ees_sharepoint/connector_queue.py | elastic/enterprise-search-sharepoint-server-2016-connector | c205809a88efde8456b5d775a8233531bf870657 | [
"Apache-2.0"
] | null | null | null | ees_sharepoint/connector_queue.py | elastic/enterprise-search-sharepoint-server-2016-connector | c205809a88efde8456b5d775a8233531bf870657 | [
"Apache-2.0"
] | null | null | null | #
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License 2.0;
# you may not use this file except in compliance with the Elastic License 2.0.
#
import multiprocessing
from multiprocessing.queues import Queue
BATCH_SIZE ... | 35.435897 | 114 | 0.688133 | import multiprocessing
from multiprocessing.queues import Queue
BATCH_SIZE = 100
class ConnectorQueue(Queue):
def __init__(self, logger):
ctx = multiprocessing.get_context()
self.logger = logger
super(ConnectorQueue, self).__init__(ctx=ctx)
def end_signal(self):
signal_clos... | true | true |
f772dc26ac758996d268f3c2c510dd02ef7c1e6e | 2,572 | py | Python | letsencrypt/certbot-dns-linode/setup.py | fengshukun/intapp | b09e8ee0ebf8eaa1474e1c9bd075ef9fd1fb1726 | [
"MIT"
] | 1 | 2019-12-23T06:39:49.000Z | 2019-12-23T06:39:49.000Z | letsencrypt/certbot-dns-linode/setup.py | fengshukun/intapp | b09e8ee0ebf8eaa1474e1c9bd075ef9fd1fb1726 | [
"MIT"
] | null | null | null | letsencrypt/certbot-dns-linode/setup.py | fengshukun/intapp | b09e8ee0ebf8eaa1474e1c9bd075ef9fd1fb1726 | [
"MIT"
] | null | null | null | import sys
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test as TestCommand
version = '1.1.0.dev0'
# Please update tox.ini when modifying dependency version requirements
install_requires = [
'acme>=0.31.0',
'certbot>=1.0.0.dev0',
'dns-lexicon>=2.2.... | 30.258824 | 81 | 0.620529 | import sys
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test as TestCommand
version = '1.1.0.dev0'
install_requires = [
'acme>=0.31.0',
'certbot>=1.0.0.dev0',
'dns-lexicon>=2.2.3',
'mock',
'setuptools',
'zope.interface',
]
docs_extras ... | true | true |
f772dc29b385bafc5dbd85cbabbd23ea9d7bbdbb | 1,945 | py | Python | copy_a_file.py | Matthew-Wright-CPA-PSM-ACA/Python-scripts | 6b171822cdb502f85dce603408bd43b63476d08f | [
"CNRI-Python"
] | null | null | null | copy_a_file.py | Matthew-Wright-CPA-PSM-ACA/Python-scripts | 6b171822cdb502f85dce603408bd43b63476d08f | [
"CNRI-Python"
] | null | null | null | copy_a_file.py | Matthew-Wright-CPA-PSM-ACA/Python-scripts | 6b171822cdb502f85dce603408bd43b63476d08f | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python3
# -UTF-8
# ***********************************************************
# SCRIPT copy_a_file: Copy a file line by line
# Usage: copy_a_file <file source> <new file destination>
# In BASH: python copy_a_file.py copyingfile newfile
import sys
import os
def main():
# Verify the ... | 36.018519 | 131 | 0.575321 |
import sys
import os
def main():
if len(sys.argv) == 3:
inputFile = sys.argv[1]
outputFile = sys.argv[2]
else:
print(__doc__)
sys.exit(1)
if not os.path.isfile(inputFile):
print("error - following file does not exist: {}".format(inputFile... | true | true |
f772dcb3f4aa840cb7b30e63204f5625827d540e | 1,257 | py | Python | src_ros2/ros2_sim_indy_pybullet/ros2_sim_indy_pybullet/indy7_fixed_cam_test.py | zhaoruinan/indy_vision_task_sim | 71500c69de53808f8a691d600e56213c1768a9c6 | [
"Apache-2.0"
] | null | null | null | src_ros2/ros2_sim_indy_pybullet/ros2_sim_indy_pybullet/indy7_fixed_cam_test.py | zhaoruinan/indy_vision_task_sim | 71500c69de53808f8a691d600e56213c1768a9c6 | [
"Apache-2.0"
] | null | null | null | src_ros2/ros2_sim_indy_pybullet/ros2_sim_indy_pybullet/indy7_fixed_cam_test.py | zhaoruinan/indy_vision_task_sim | 71500c69de53808f8a691d600e56213c1768a9c6 | [
"Apache-2.0"
] | null | null | null | import pybullet as p
import time
import numpy as np
objects = ['apple', 'orange', 'banana', 'milk', 'orange']
p.connect(p.GUI)
p.setGravity(0, 0, -9.8)
#planeId = p.loadURDF("plane.urdf", [0, 0, 0])
TableId = p.loadURDF("table/table.urdf", [0.45, 0.35, -0.65])
indyId= p.loadURDF("indy7.urdf", [0, 0, 0])
num_obj = len(o... | 32.230769 | 69 | 0.687351 | import pybullet as p
import time
import numpy as np
objects = ['apple', 'orange', 'banana', 'milk', 'orange']
p.connect(p.GUI)
p.setGravity(0, 0, -9.8)
TableId = p.loadURDF("table/table.urdf", [0.45, 0.35, -0.65])
indyId= p.loadURDF("indy7.urdf", [0, 0, 0])
num_obj = len(objects)
obj_postions = np.random.rand(num_obj,2... | true | true |
f772dcd07b60822b4076e1ca80ce65faef56d079 | 953 | py | Python | fanscribed/apps/podcasts/tests/test_register.py | fanscribed/fanscribed | 89b14496459f81a152df38ed5098fba2b087a1d7 | [
"MIT"
] | 8 | 2015-01-05T07:04:02.000Z | 2016-07-19T17:56:46.000Z | fanscribed/apps/podcasts/tests/test_register.py | fanscribed/fanscribed | 89b14496459f81a152df38ed5098fba2b087a1d7 | [
"MIT"
] | 32 | 2015-03-18T18:51:00.000Z | 2021-06-10T20:37:33.000Z | fanscribed/apps/podcasts/tests/test_register.py | fanscribed/fanscribed | 89b14496459f81a152df38ed5098fba2b087a1d7 | [
"MIT"
] | 5 | 2015-02-10T21:15:32.000Z | 2016-06-02T17:26:14.000Z | """Podcast registration tests."""
from httplib import OK
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
class RegistrationTestCase(TestCase):
def setUp(self):
self.account_login_url = reverse('account_login')
self.regist... | 32.862069 | 76 | 0.691501 |
from httplib import OK
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
class RegistrationTestCase(TestCase):
def setUp(self):
self.account_login_url = reverse('account_login')
self.register_url = reverse('podcasts:registe... | true | true |
f772dd2c8148049f5d9b2e7979e90288481315bd | 2,939 | py | Python | tests/integration/lambdas/test_lambda_gsbot_graph.py | pbx-gs/OSBot-jira | 7677afee1f80398ddcccd6b45423bf6adc20b970 | [
"Apache-2.0"
] | 1 | 2019-08-06T15:40:45.000Z | 2019-08-06T15:40:45.000Z | tests/integration/lambdas/test_lambda_gsbot_graph.py | pbx-gs/OSBot-jira | 7677afee1f80398ddcccd6b45423bf6adc20b970 | [
"Apache-2.0"
] | 1 | 2021-09-03T09:55:39.000Z | 2021-09-03T09:55:39.000Z | tests/integration/lambdas/test_lambda_gsbot_graph.py | filetrust/OSBot-jira | d753fff59cf938cf94a51bf8bc7981691524b686 | [
"Apache-2.0"
] | 2 | 2021-04-02T05:58:29.000Z | 2021-09-03T09:43:29.000Z | from osbot_aws.apis.Lambda import Lambda
from osbot_aws.helpers.Lambda_Package import Lambda_Package
from gw_bot.Deploy import Deploy
from osbot_aws.helpers.Test_Helper import Test_Helper
from osbot_utils.utils.Dev import Dev
from osbot_jira.lambdas.graph import run
class test_lambda_gsbot_graph(Test_Helper):
d... | 31.602151 | 93 | 0.659748 | from osbot_aws.apis.Lambda import Lambda
from osbot_aws.helpers.Lambda_Package import Lambda_Package
from gw_bot.Deploy import Deploy
from osbot_aws.helpers.Test_Helper import Test_Helper
from osbot_utils.utils.Dev import Dev
from osbot_jira.lambdas.graph import run
class test_lambda_gsbot_graph(Test_Helper):
d... | true | true |
f772dd5300b74e1b8c18a4c726c3d6e29a049f0c | 535 | py | Python | wp2pelican.py | shan-x/wp2pelican | 9a843fcaeb065ddafba40695584e34188938db84 | [
"Apache-2.0"
] | null | null | null | wp2pelican.py | shan-x/wp2pelican | 9a843fcaeb065ddafba40695584e34188938db84 | [
"Apache-2.0"
] | null | null | null | wp2pelican.py | shan-x/wp2pelican | 9a843fcaeb065ddafba40695584e34188938db84 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# coding: utf-8
import requests
import queries
from jinja2 import Environment, FileSystemLoader
import os
import json
import sys, os
sys.path.append(os.curdir)
from wp2pelicanconf import *
from getfromwp import *
if __name__ == "__main__":
print('Starting')
posts = Content("posts", queri... | 19.107143 | 60 | 0.699065 |
import requests
import queries
from jinja2 import Environment, FileSystemLoader
import os
import json
import sys, os
sys.path.append(os.curdir)
from wp2pelicanconf import *
from getfromwp import *
if __name__ == "__main__":
print('Starting')
posts = Content("posts", queries.get_posts, "post.html")
post... | true | true |
f772dd56578d51e767edb996c721ab969c43e1e9 | 1,802 | py | Python | bin/scons-unzip.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 3 | 2017-01-06T09:26:23.000Z | 2017-03-04T04:13:20.000Z | bin/scons-unzip.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 2 | 2015-10-27T20:17:24.000Z | 2016-08-04T21:49:56.000Z | bin/scons-unzip.py | datalogics-staylor/scons | 4c48deb6947066e53aac7d86621a7ec17f3b4034 | [
"MIT"
] | 4 | 2015-03-31T16:09:15.000Z | 2021-08-04T12:41:47.000Z | #!/usr/bin/env python
#
# A quick script to unzip a .zip archive and put the files in a
# subdirectory that matches the basename of the .zip file.
#
# This is actually generic functionality, it's not SCons-specific, but
# I'm using this to make it more convenient to manage working on multiple
# changes on Windows, wher... | 25.380282 | 73 | 0.596004 | # I'm using this to make it more convenient to manage working on multiple
#
import getopt
import os.path
import sys
import zipfile
helpstr = """\
Usage: scons-unzip.py [-o outdir] zipfile
Options:
-o DIR, --out DIR Change output directory name to DIR
-v, --verbose Print file names when ext... | false | true |
f772de10c181a8813b26c8ad8357c771b998319e | 17,860 | py | Python | env/lib/python3.8/site-packages/plotly/graph_objs/funnelarea/_hoverlabel.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/funnelarea/_hoverlabel.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/funnelarea/_hoverlabel.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "funnelarea"
_path_str = "funnelarea.hoverlabel"
_valid_props = {
"align",
... | 35.436508 | 82 | 0.558455 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Hoverlabel(_BaseTraceHierarchyType):
_parent_path_str = "funnelarea"
_path_str = "funnelarea.hoverlabel"
_valid_props = {
"align",
"alignsrc",
"bgcolor",
"... | true | true |
f772de1ce272a82be74fa0c21b4d6e36641245fb | 282 | py | Python | brml/variable/variable.py | herupraptono/pybrml | 42fa70f17c303943447816234a87b3c5815f12bb | [
"CNRI-Python"
] | 136 | 2015-02-15T15:10:56.000Z | 2022-03-09T10:08:17.000Z | brml/variable/variable.py | herupraptono/pybrml | 42fa70f17c303943447816234a87b3c5815f12bb | [
"CNRI-Python"
] | null | null | null | brml/variable/variable.py | herupraptono/pybrml | 42fa70f17c303943447816234a87b3c5815f12bb | [
"CNRI-Python"
] | 43 | 2015-02-15T15:11:25.000Z | 2021-07-16T15:08:10.000Z | #!/usr/bin/env python
"Basic Class: variable"
if __name__ == '__main__':
print 'VariableClass is running by itself'
else:
print 'VariableClass is imported as module'
class variable:
def __init__(self, name = [], domain= []):
self.name = name
self.domain = domain | 23.5 | 47 | 0.680851 |
"Basic Class: variable"
if __name__ == '__main__':
print 'VariableClass is running by itself'
else:
print 'VariableClass is imported as module'
class variable:
def __init__(self, name = [], domain= []):
self.name = name
self.domain = domain | false | true |
f772de458a2f02da968d93f8bc7c9497c5677ff4 | 1,370 | py | Python | dom1.py | DarkestEver/Mongodb | 5993c2c6149f1b8b3dcf4596e1e9fe07203e395b | [
"Apache-2.0"
] | null | null | null | dom1.py | DarkestEver/Mongodb | 5993c2c6149f1b8b3dcf4596e1e9fe07203e395b | [
"Apache-2.0"
] | null | null | null | dom1.py | DarkestEver/Mongodb | 5993c2c6149f1b8b3dcf4596e1e9fe07203e395b | [
"Apache-2.0"
] | null | null | null | import os
import mainlib1 as run
import time
import random as rn
linkedin_username = "keshavjain16@outlook.com"
linkedin_password = "P"
instant_id = 0
search_limit_url = 100
url_table1 = 'prod.workondomain'
dir_path = 'C:\\Users\\Administrator\\Desktop\\'
min_time = 3600
while True:
strt_tm = time.time()
... | 31.860465 | 79 | 0.553285 | import os
import mainlib1 as run
import time
import random as rn
linkedin_username = "keshavjain16@outlook.com"
linkedin_password = "P"
instant_id = 0
search_limit_url = 100
url_table1 = 'prod.workondomain'
dir_path = 'C:\\Users\\Administrator\\Desktop\\'
min_time = 3600
while True:
strt_tm = time.time()
... | true | true |
f772dec308428817ef6e988aa1bd63fc1016f4b0 | 958 | py | Python | migrations/versions/9c89305219d0_.py | Selebinka/payment_services | 9d1c76e6461415a75ae3b25d910ec3dab46061f1 | [
"MIT"
] | null | null | null | migrations/versions/9c89305219d0_.py | Selebinka/payment_services | 9d1c76e6461415a75ae3b25d910ec3dab46061f1 | [
"MIT"
] | null | null | null | migrations/versions/9c89305219d0_.py | Selebinka/payment_services | 9d1c76e6461415a75ae3b25d910ec3dab46061f1 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 9c89305219d0
Revises:
Create Date: 2019-11-21 09:51:18.145990
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9c89305219d0'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... | 25.891892 | 65 | 0.674322 | from alembic import op
import sqlalchemy as sa
revision = '9c89305219d0'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.drop_table('payments')
def downgrade():
op.create_table('payments',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('currency'... | true | true |
f772dee696770c589512d8b82f5f95287a382340 | 5,407 | py | Python | koans/about_lists.py | laurenkch/python_koans | 7edf8c8229886a442c27f2ed746923a8a9dd3cf2 | [
"MIT"
] | null | null | null | koans/about_lists.py | laurenkch/python_koans | 7edf8c8229886a442c27f2ed746923a8a9dd3cf2 | [
"MIT"
] | null | null | null | koans/about_lists.py | laurenkch/python_koans | 7edf8c8229886a442c27f2ed746923a8a9dd3cf2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutArrays in the Ruby Koans
#
from runner.koan import *
class AboutLists(Koan):
def test_creating_lists(self):
empty_list = list()
self.assertEqual(list, type(empty_list))
self.assertEqual(0, len(empty_list))
# an empty... | 36.046667 | 141 | 0.614019 |
from runner.koan import *
class AboutLists(Koan):
def test_creating_lists(self):
empty_list = list()
self.assertEqual(list, type(empty_list))
self.assertEqual(0, len(empty_list))
def test_list_literals(self):
nums = list()
self.assertEqual([], nums)
... | true | true |
f772deec8c401fe11d4f12d4bfc95f8798bd75f8 | 432 | py | Python | logger.py | nfe-w/weibo-del-sent-comments | de97b9edc80f100d3b61b576efb6da02487417b5 | [
"MIT"
] | 1 | 2022-03-15T01:25:29.000Z | 2022-03-15T01:25:29.000Z | logger.py | nfe-w/weibo-del-sent-comments | de97b9edc80f100d3b61b576efb6da02487417b5 | [
"MIT"
] | null | null | null | logger.py | nfe-w/weibo-del-sent-comments | de97b9edc80f100d3b61b576efb6da02487417b5 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger()
def set_logger():
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(process)d-%(threadName)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
console_handler = logging.St... | 22.736842 | 138 | 0.696759 |
import logging
logger = logging.getLogger()
def set_logger():
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(process)d-%(threadName)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
console_handler = logging.StreamHandler()
console_handler.setFormatter(f... | true | true |
f772e103598ac33480200627f2d54bd976f69c78 | 958 | py | Python | src/pychannel/sections/tests/cases_trapezoidal.py | fmestres/pyChannel | 507ac78532b46473cd60c3f55175974cda47369e | [
"MIT"
] | null | null | null | src/pychannel/sections/tests/cases_trapezoidal.py | fmestres/pyChannel | 507ac78532b46473cd60c3f55175974cda47369e | [
"MIT"
] | null | null | null | src/pychannel/sections/tests/cases_trapezoidal.py | fmestres/pyChannel | 507ac78532b46473cd60c3f55175974cda47369e | [
"MIT"
] | null | null | null | invalid_property_value_test_cases = [
#(<base_width>, <side_slope_1>, <side_slope_2>, <flow_depth>)
(0, 0, 0, -0.000001),
(0, 0, -0.000001, 0),
(0, -0.000001, 0, 0),
(-0.000001, 0, 0, 0),
(1, 1, 1, -1),
(1, 1, -1, 1),
(1, -1, 1, 1),
(-1, 1, 1, 1)
]
undefined_flow_depth_test_cases ... | 22.809524 | 90 | 0.454071 | invalid_property_value_test_cases = [
(0, 0, 0, -0.000001),
(0, 0, -0.000001, 0),
(0, -0.000001, 0, 0),
(-0.000001, 0, 0, 0),
(1, 1, 1, -1),
(1, 1, -1, 1),
(1, -1, 1, 1),
(-1, 1, 1, 1)
]
undefined_flow_depth_test_cases = [
(4, 1, 1),
(0, 0, 0),
(99999, 99999, 99999),... | true | true |
f772e2411e50c491674282595b714057033e9694 | 3,597 | py | Python | homeassistant/components/telegram_bot/webhooks.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | homeassistant/components/telegram_bot/webhooks.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/components/telegram_bot/webhooks.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for Telegram bots using webhooks."""
import datetime as dt
from ipaddress import ip_address
import logging
from telegram.error import TimedOut
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP,
HTTP_BAD_REQUEST,
HTTP_UNAUTHORI... | 32.116071 | 87 | 0.682235 | import datetime as dt
from ipaddress import ip_address
import logging
from telegram.error import TimedOut
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP,
HTTP_BAD_REQUEST,
HTTP_UNAUTHORIZED,
)
from homeassistant.helpers.network import... | true | true |
f772e2924b95583a4dfefc1b661518d94247a92f | 33,351 | py | Python | tests/www/test_views.py | chazmo03/airflow | 86c01469782269686d0e1431a85954f9618b60b0 | [
"Apache-2.0"
] | null | null | null | tests/www/test_views.py | chazmo03/airflow | 86c01469782269686d0e1431a85954f9618b60b0 | [
"Apache-2.0"
] | null | null | null | tests/www/test_views.py | chazmo03/airflow | 86c01469782269686d0e1431a85954f9618b60b0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: 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
#... | 37.985194 | 109 | 0.634524 |
import io
import copy
import logging.config
import mock
import os
import shutil
import tempfile
import unittest
import sys
import json
from urllib.parse import quote_plus
from werkzeug.test import Client
from airflow import models, configuration
from airflow.config_templates.airflow_local_settings import DEFAULT_LOG... | true | true |
f772e3464dd11f0912821c6daa08076abf218380 | 652 | py | Python | Bugscan_exploits-master/exp_list/exp-356.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-356.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-356.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def assign(service,arg):
if service == "qibocms":
return True, arg
def audit(arg):
payload = "f/job.php?job=getzone&typeid=zone&fup=..\..\do\js&id=514125&webdb[web_open]=1&webdb[cache_time_js]=-1&pre=qb_label%20where%20lid=-1%20UNION%20SELECT%201,2,3,4,5,6,0,m... | 32.6 | 222 | 0.656442 |
def assign(service,arg):
if service == "qibocms":
return True, arg
def audit(arg):
payload = "f/job.php?job=getzone&typeid=zone&fup=..\..\do\js&id=514125&webdb[web_open]=1&webdb[cache_time_js]=-1&pre=qb_label%20where%20lid=-1%20UNION%20SELECT%201,2,3,4,5,6,0,md5(233),9,10,11,12,13,14,15,16,17,18,19%23"
ur... | true | true |
f772e4bc69ac83d9dcf4f8892010885fca74de29 | 15,616 | py | Python | nova/tests/unit/test_fixtures.py | bopopescu/Trusted-Platform-Module-nova | 20d28ef29daf6fd7a67b37b87ec2561c34b4230b | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/tests/unit/test_fixtures.py | bopopescu/Trusted-Platform-Module-nova | 20d28ef29daf6fd7a67b37b87ec2561c34b4230b | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/test_fixtures.py | bopopescu/Trusted-Platform-Module-nova | 20d28ef29daf6fd7a67b37b87ec2561c34b4230b | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 t... | 37.538462 | 78 | 0.657018 |
import sqlalchemy
import sys
import fixtures as fx
import mock
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import uuidutils
import testtools
from nova.db.sqlalchemy import api as session
from nova import exception
from nova.objects import base as obj_base
from nova.tests import fi... | true | true |
f772e5726d0c921ccf458e4e9dd35a18378bbd91 | 6,283 | py | Python | configuration/common/__init__.py | Neoteroi/essentials-configuration | 734b9848eafd37d5912d57c3acd95dc7f3243ffe | [
"MIT"
] | 2 | 2021-08-10T09:14:09.000Z | 2021-11-27T01:27:16.000Z | configuration/common/__init__.py | Neoteroi/essentials-configuration | 734b9848eafd37d5912d57c3acd95dc7f3243ffe | [
"MIT"
] | 1 | 2021-08-11T21:06:27.000Z | 2021-08-11T21:06:27.000Z | configuration/common/__init__.py | Neoteroi/essentials-configuration | 734b9848eafd37d5912d57c3acd95dc7f3243ffe | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from collections import abc
from typing import Any, Dict, List, Mapping, Optional
from ..errors import ConfigurationOverrideError
def apply_key_value(obj, key, value):
key = key.strip("_:") # remove special characters from both ends
for token in (":", "__"):
if to... | 33.59893 | 88 | 0.565335 | from abc import ABC, abstractmethod
from collections import abc
from typing import Any, Dict, List, Mapping, Optional
from ..errors import ConfigurationOverrideError
def apply_key_value(obj, key, value):
key = key.strip("_:") for token in (":", "__"):
if token in key:
parts = key.split(t... | true | true |
f772e59c06e6b800914a60cafa777c75b27fa5dc | 1,926 | py | Python | utils.py | rksingh95/prediction-service | fc922b11272db93f8435deb332ceec59caacb56b | [
"MIT"
] | 3 | 2021-04-02T11:54:08.000Z | 2022-02-21T08:07:46.000Z | utils.py | rksingh95/prediction-service | fc922b11272db93f8435deb332ceec59caacb56b | [
"MIT"
] | null | null | null | utils.py | rksingh95/prediction-service | fc922b11272db93f8435deb332ceec59caacb56b | [
"MIT"
] | null | null | null | import json
import os
from app import app
def invalid_file_error_response(data) -> json:
data = {"detail_error": 'File format not supported only supported are .jpeg and .png but received a' + ' ' + data}
response = app.response_class(
response=json.dumps(data),
status=400,
mimetype='a... | 26.383562 | 118 | 0.637072 | import json
import os
from app import app
def invalid_file_error_response(data) -> json:
data = {"detail_error": 'File format not supported only supported are .jpeg and .png but received a' + ' ' + data}
response = app.response_class(
response=json.dumps(data),
status=400,
mimetype='a... | true | true |
f772e5b4a86ee9267ab9234ff8197c72c91ef62a | 16,056 | py | Python | models/RelationNetworks/relation_rcnn/core/rcnn.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/RelationNetworks/relation_rcnn/core/rcnn.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | models/RelationNetworks/relation_rcnn/core/rcnn.py | RamsteinWR/PneumoniaRSNA1 | 08bdba51292307a78ef711c6be4a63faea240ddf | [
"MIT"
] | null | null | null | """
Fast R-CNN:
data =
{'data': [num_images, c, h, w],
'rois': [num_rois, 5]}
label =
{'label': [num_rois],
'bbox_target': [num_rois, 4 * num_classes],
'bbox_weight': [num_rois, 4 * num_classes]}
roidb extended format [image_index]
['image', 'height', 'width', 'flipped',
'boxes', 'gt_classe... | 41.921671 | 115 | 0.607686 |
import numpy as np
import numpy.random as npr
from bbox.bbox_regression import expand_bbox_regression_targets
from bbox.bbox_transform import bbox_overlaps, bbox_transform
from utils.image import get_image, tensor_vstack
def get_rcnn_testbatch(roidb, cfg):
imgs, roidb = get_image(roidb, cfg)
im_array = i... | true | true |
f772e61752f7d6478e2b797f5d5a19e474237ce0 | 6,995 | py | Python | testnet/prolog/interpreter/test/test_parsing.py | ForoughA/CORGI | c28ecd0e0375569f9f05e94e6ae5b7a994caacf5 | [
"MIT"
] | 22 | 2020-06-18T23:36:29.000Z | 2021-12-11T12:39:51.000Z | prolog/interpreter/test/test_parsing.py | cosmoharrigan/pyrolog | b250e3ec0109049dea09419f2ad6a8ed14d92ff0 | [
"MIT"
] | 1 | 2020-06-27T01:57:12.000Z | 2020-10-05T03:54:44.000Z | prolog/interpreter/test/test_parsing.py | leonweber/spyrolog | 31834f64a7f4bc67e8aad5174ed71f3b7af9bc09 | [
"MIT"
] | 5 | 2019-08-08T04:58:53.000Z | 2021-11-13T08:06:29.000Z | import py
from prolog.interpreter.signature import Signature
from prolog.interpreter.parsing import parse_file, TermBuilder, OrderTransformer
from prolog.interpreter.parsing import parse_query_term, ParseError
from prolog.interpreter.heap import Heap
from prolog.interpreter import error
def test_simple():
t = par... | 25.529197 | 124 | 0.527234 | import py
from prolog.interpreter.signature import Signature
from prolog.interpreter.parsing import parse_file, TermBuilder, OrderTransformer
from prolog.interpreter.parsing import parse_query_term, ParseError
from prolog.interpreter.heap import Heap
from prolog.interpreter import error
def test_simple():
t = par... | false | true |
f772e62c28f6311af4b6f1cd7b4c4751d1d8bcff | 5,993 | py | Python | synapse/handlers/events.py | zauguin/synapse | ea00f18135ce30e8415526ce68585ea90da5b856 | [
"Apache-2.0"
] | 1 | 2019-08-29T05:52:15.000Z | 2019-08-29T05:52:15.000Z | synapse/handlers/events.py | zauguin/synapse | ea00f18135ce30e8415526ce68585ea90da5b856 | [
"Apache-2.0"
] | null | null | null | synapse/handlers/events.py | zauguin/synapse | ea00f18135ce30e8415526ce68585ea90da5b856 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket 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 applicab... | 34.843023 | 88 | 0.600367 |
import logging
import random
from twisted.internet import defer
from synapse.api.constants import EventTypes, Membership
from synapse.api.errors import AuthError
from synapse.events import EventBase
from synapse.events.utils import serialize_event
from synapse.types import UserID
from synapse.util.logutils import lo... | true | true |
f772e63222418c5e274878cd0fd215e2e060e471 | 5,823 | py | Python | backend/binrange.py | ezg/PanoramicDataWin8 | 229e9ab64cda30a0bd1c6d39a70754ba4651ad43 | [
"Apache-2.0"
] | 2 | 2015-09-29T03:25:03.000Z | 2021-04-29T03:17:28.000Z | backend/binrange.py | ezg/PanoramicDataWin8 | 229e9ab64cda30a0bd1c6d39a70754ba4651ad43 | [
"Apache-2.0"
] | 1 | 2016-09-25T21:45:21.000Z | 2016-09-25T21:45:21.000Z | backend/binrange.py | ezg/PanoramicDataWin8 | 229e9ab64cda30a0bd1c6d39a70754ba4651ad43 | [
"Apache-2.0"
] | 2 | 2015-10-26T17:21:48.000Z | 2016-10-29T15:45:32.000Z | #!/usr/bin/python
import json
import numpy as np
import pandas as pd
import math
class BinRange():
def __init__(self, dataMinValue, dataMaxValue, targetBinNumber):
self.dataMinValue = float(dataMinValue)
self.dataMaxValue = float(dataMaxValue)
self.targetBinNumber = float(targetBinNumber)
... | 30.015464 | 100 | 0.577366 | import json
import numpy as np
import pandas as pd
import math
class BinRange():
def __init__(self, dataMinValue, dataMaxValue, targetBinNumber):
self.dataMinValue = float(dataMinValue)
self.dataMaxValue = float(dataMaxValue)
self.targetBinNumber = float(targetBinNumber)
self.maxVal... | true | true |
f772e6d70eb4980340b67beab634c8264cb18e5f | 30,635 | py | Python | src/run.py | NCIPangaea/CCBR_GATK4_Exome_Seq_Pipeline | 57eaa2eae00970ba0d24f712de3162ff08cbf8ee | [
"MIT"
] | 2 | 2021-10-14T19:45:59.000Z | 2022-01-31T17:13:44.000Z | src/run.py | NCIPangaea/CCBR_GATK4_Exome_Seq_Pipeline | 57eaa2eae00970ba0d24f712de3162ff08cbf8ee | [
"MIT"
] | 4 | 2021-11-20T00:05:46.000Z | 2021-12-30T15:54:17.000Z | src/run.py | NCIPangaea/CCBR_GATK4_Exome_Seq_Pipeline | 57eaa2eae00970ba0d24f712de3162ff08cbf8ee | [
"MIT"
] | 3 | 2021-11-05T01:27:18.000Z | 2021-12-03T17:18:10.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Python standard library
from __future__ import print_function
from shutil import copytree
import os, re, json, sys, subprocess
# Local imports
from utils import (git_commit_hash,
join_jsons,
fatal,
which,
exists,
err)
from . import version as __ver... | 43.087201 | 137 | 0.645634 |
from __future__ import print_function
from shutil import copytree
import os, re, json, sys, subprocess
from utils import (git_commit_hash,
join_jsons,
fatal,
which,
exists,
err)
from . import version as __version__
def init(repo_path, output_path, links=[], required=['workflow', 'resources', 'c... | true | true |
f772e80438ef32495f6aa563b700e429b1e0758f | 5,547 | py | Python | module_5/helpful_flow.py | banjtheman/odsc_nlp_workshop | 6562938fff0e9e50d4db8feed5552eaaa7a7f1f6 | [
"Apache-2.0"
] | null | null | null | module_5/helpful_flow.py | banjtheman/odsc_nlp_workshop | 6562938fff0e9e50d4db8feed5552eaaa7a7f1f6 | [
"Apache-2.0"
] | null | null | null | module_5/helpful_flow.py | banjtheman/odsc_nlp_workshop | 6562938fff0e9e50d4db8feed5552eaaa7a7f1f6 | [
"Apache-2.0"
] | null | null | null | # Python imports
import logging
import os
# Project imports
import utils as helpful_funcs
# 3rd party imports
from metaflow import FlowSpec, Parameter, step, card
import numpy as np
# How to run
# python helpful_flow.py run --output_dir test_run
class HelpfulFlow(FlowSpec):
"""
This flow will run the Helpf... | 25.680556 | 85 | 0.608798 | import logging
import os
import utils as helpful_funcs
from metaflow import FlowSpec, Parameter, step, card
import numpy as np
class HelpfulFlow(FlowSpec):
output_dir = Parameter(
"output_dir",
default="test_run",
help="Location of output files",
required=True,
)
t... | true | true |
f772e868c3f98122889cabb065cc256bc7973eb1 | 911 | py | Python | VCPlayBot/helpers/decorators.py | UdayBindal2312/TG-VCMusicRobot | cf25fcb12d9bcc0f2de170324996c6791447ed60 | [
"MIT"
] | 1 | 2021-08-18T03:05:11.000Z | 2021-08-18T03:05:11.000Z | VCPlayBot/helpers/decorators.py | UdayBindal2312/TG-VCMusicRobot | cf25fcb12d9bcc0f2de170324996c6791447ed60 | [
"MIT"
] | null | null | null | VCPlayBot/helpers/decorators.py | UdayBindal2312/TG-VCMusicRobot | cf25fcb12d9bcc0f2de170324996c6791447ed60 | [
"MIT"
] | null | null | null | from typing import Callable
from pyrogram import Client
from pyrogram.types import Message
from VCPlayBot.config import SUDO_USERS
from VCPlayBot.helpers.admins import get_administrators
def errors(func: Callable) -> Callable:
async def decorator(client: Client, message: Message):
try:
retur... | 28.46875 | 63 | 0.695939 | from typing import Callable
from pyrogram import Client
from pyrogram.types import Message
from VCPlayBot.config import SUDO_USERS
from VCPlayBot.helpers.admins import get_administrators
def errors(func: Callable) -> Callable:
async def decorator(client: Client, message: Message):
try:
retur... | true | true |
f772e92eb3dfe07f3382da9292b0260d436b98eb | 5,967 | py | Python | tests/test_yes_com.py | fabian-hk/dnssec_scanner | 437ca39bb84e592b81f146c9e711c93687a43ae3 | [
"BSD-2-Clause"
] | 1 | 2020-03-19T16:02:11.000Z | 2020-03-19T16:02:11.000Z | tests/test_yes_com.py | fabian-hk/dnssec_scanner | 437ca39bb84e592b81f146c9e711c93687a43ae3 | [
"BSD-2-Clause"
] | 1 | 2020-03-06T02:35:49.000Z | 2020-03-12T16:41:43.000Z | tests/test_yes_com.py | fabian-hk/dnssec_scanner | 437ca39bb84e592b81f146c9e711c93687a43ae3 | [
"BSD-2-Clause"
] | null | null | null | import logging
import dns.rdatatype
import re
from tests.utils.custom_test_case import CustomTestCase as CTC
from dnssec_scanner import DNSSECScanner, State
from dnssec_scanner.messages import Validator, Msg, Types
from tests.utils.messages_testing import TestMessage
log = logging.getLogger("dnssec_scanner")
log.set... | 50.567797 | 120 | 0.613038 | import logging
import dns.rdatatype
import re
from tests.utils.custom_test_case import CustomTestCase as CTC
from dnssec_scanner import DNSSECScanner, State
from dnssec_scanner.messages import Validator, Msg, Types
from tests.utils.messages_testing import TestMessage
log = logging.getLogger("dnssec_scanner")
log.set... | true | true |
f772eaa8c96af5d6ffef143c4d7ead6298e5f1be | 8,688 | py | Python | devolearn/cell_membrane_segmentor/cell_membrane_segmentor.py | kingjuno/devolearn | 555c8c55441a4f0b9ed8801c37d07c45b03ec774 | [
"MIT"
] | 35 | 2020-08-03T06:36:18.000Z | 2022-02-27T13:53:48.000Z | devolearn/cell_membrane_segmentor/cell_membrane_segmentor.py | kingjuno/devolearn | 555c8c55441a4f0b9ed8801c37d07c45b03ec774 | [
"MIT"
] | 42 | 2020-08-02T17:17:31.000Z | 2021-09-16T06:13:48.000Z | devolearn/cell_membrane_segmentor/cell_membrane_segmentor.py | kingjuno/devolearn | 555c8c55441a4f0b9ed8801c37d07c45b03ec774 | [
"MIT"
] | 40 | 2020-08-02T16:45:42.000Z | 2022-02-15T07:30:14.000Z | import torch
import torch.nn as nn
from torch.nn import functional as F
import torchvision
import torchvision.transforms as transforms
from torchvision.transforms import ToTensor
from torchvision.transforms import ToPILImage
import os
import cv2
import wget
import imutils
from tqdm import tqdm, tqdm_notebook
from PIL ... | 38.959641 | 147 | 0.602555 | import torch
import torch.nn as nn
from torch.nn import functional as F
import torchvision
import torchvision.transforms as transforms
from torchvision.transforms import ToTensor
from torchvision.transforms import ToPILImage
import os
import cv2
import wget
import imutils
from tqdm import tqdm, tqdm_notebook
from PIL ... | true | true |
f772eaf3da784c173a59a2e62d88704bbfe7e651 | 1,367 | py | Python | Lego-Collector's-Dilemma/code.py | avi2412/nlp-dl-prework | 902d77344c351954e370a4aacf5a427db68cfad9 | [
"MIT"
] | null | null | null | Lego-Collector's-Dilemma/code.py | avi2412/nlp-dl-prework | 902d77344c351954e370a4aacf5a427db68cfad9 | [
"MIT"
] | null | null | null | Lego-Collector's-Dilemma/code.py | avi2412/nlp-dl-prework | 902d77344c351954e370a4aacf5a427db68cfad9 | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
# code starts here
data = pd.read_csv(path)
df = pd.DataFrame(data)
#print(df.iloc[0:5])
X = df.drop(['list_price'], axis = 1)
y = df.iloc[:, 1]
X_train, X_test, y_train, y_test = train_test_split (X, y, tes... | 17.986842 | 93 | 0.668617 | import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
data = pd.read_csv(path)
df = pd.DataFrame(data)
X = df.drop(['list_price'], axis = 1)
y = df.iloc[:, 1]
X_train, X_test, y_train, y_test = train_test_split (X, y, test_size = 0.3, random_state = 6)
import matplotlib.pyp... | true | true |
f772ecc58b1e241d7c485a93758c2ec546f2ae8e | 1,878 | py | Python | sympy/strategies/tests/test_core.py | eriknw/sympy | b7544e2bb74c011f6098a7e886fd77f41776c2c4 | [
"BSD-3-Clause"
] | 7 | 2015-01-14T06:55:33.000Z | 2018-08-11T14:43:52.000Z | sympy/strategies/tests/test_core.py | pbeltran/sympy-1 | 94f92b36731c2bebe6de1037c063c2a258a8a399 | [
"BSD-3-Clause"
] | 1 | 2018-02-19T04:56:04.000Z | 2018-02-19T04:56:04.000Z | sympy/strategies/tests/test_core.py | pbeltran/sympy-1 | 94f92b36731c2bebe6de1037c063c2a258a8a399 | [
"BSD-3-Clause"
] | 1 | 2016-04-24T14:39:22.000Z | 2016-04-24T14:39:22.000Z | from sympy.strategies.core import (null_safe, exhaust, memoize, condition,
chain, tryit, do_one, debug, switch, minimize)
from functools import partial
def test_null_safe():
def rl(expr):
if expr == 1:
return 2
safe_rl = null_safe(rl)
assert rl(1) == safe_rl(1)
assert ... | 21.101124 | 74 | 0.565495 | from sympy.strategies.core import (null_safe, exhaust, memoize, condition,
chain, tryit, do_one, debug, switch, minimize)
from functools import partial
def test_null_safe():
def rl(expr):
if expr == 1:
return 2
safe_rl = null_safe(rl)
assert rl(1) == safe_rl(1)
assert ... | true | true |
f772ecd4ca6b1364c110e5cce701f8ce1dc0d3b6 | 1,067 | py | Python | Join/inner_joins.py | monocilindro/qgis-earthengine-examples | 82aea8926d34ed3f4ad4a4a345ddbd225819d28f | [
"MIT"
] | 646 | 2019-12-03T06:09:03.000Z | 2022-03-28T03:37:08.000Z | Join/inner_joins.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 10 | 2019-12-30T03:42:44.000Z | 2021-05-22T07:34:07.000Z | Join/inner_joins.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 219 | 2019-12-06T02:20:53.000Z | 2022-03-30T15:14:27.000Z | import ee
from ee_plugin import Map
# Make a date filter to get images in this date range.
dateFilter = ee.Filter.date('2014-01-01', '2014-02-01')
# Load a MODIS collection with EVI data.
mcd43a4 = ee.ImageCollection('MODIS/MCD43A4_006_EVI') \
.filter(dateFilter)
# Load a MODIS collection with quality data.
mc... | 29.638889 | 114 | 0.746954 | import ee
from ee_plugin import Map
dateFilter = ee.Filter.date('2014-01-01', '2014-02-01')
mcd43a4 = ee.ImageCollection('MODIS/MCD43A4_006_EVI') \
.filter(dateFilter)
mcd43a2 = ee.ImageCollection('MODIS/006/MCD43A2') \
.filter(dateFilter)
innerJoin = ee.Join.inner()
filterTimeEq = ee.Filter.equals(**{
... | true | true |
f772ef36a35f60ad362561e5a89046bec126f7ef | 31,033 | py | Python | pgtrigger/core.py | arpitremarkable/django-pgtrigger | 11a69b88c46176eec04100d5b2f3d46612391a5f | [
"BSD-3-Clause"
] | null | null | null | pgtrigger/core.py | arpitremarkable/django-pgtrigger | 11a69b88c46176eec04100d5b2f3d46612391a5f | [
"BSD-3-Clause"
] | null | null | null | pgtrigger/core.py | arpitremarkable/django-pgtrigger | 11a69b88c46176eec04100d5b2f3d46612391a5f | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import copy
import hashlib
import logging
import threading
from django.db import connection, connections, router
from django.db import models
from django.db.models.expressions import Col
from django.db.models.fields.related import RelatedField
from django.db.models.sql import Query
from django.db.mod... | 30.514258 | 113 | 0.591338 | import contextlib
import copy
import hashlib
import logging
import threading
from django.db import connection, connections, router
from django.db import models
from django.db.models.expressions import Col
from django.db.models.fields.related import RelatedField
from django.db.models.sql import Query
from django.db.mod... | true | true |
f772ef734da3f20e0bf96a16bb77ac120c782597 | 1,901 | py | Python | src/tests/conftest.py | ibrahim-sheriff/Deploying-a-ML-Model-on-Heroku-with-FastAPI | 483c563d0e3838580f5cd643c70db6a47e1c1219 | [
"MIT"
] | null | null | null | src/tests/conftest.py | ibrahim-sheriff/Deploying-a-ML-Model-on-Heroku-with-FastAPI | 483c563d0e3838580f5cd643c70db6a47e1c1219 | [
"MIT"
] | null | null | null | src/tests/conftest.py | ibrahim-sheriff/Deploying-a-ML-Model-on-Heroku-with-FastAPI | 483c563d0e3838580f5cd643c70db6a47e1c1219 | [
"MIT"
] | 2 | 2021-11-09T01:07:02.000Z | 2021-12-26T05:12:08.000Z | """
Author: Ibrahim Sherif
Date: October, 2021
This script holds the conftest data used with pytest module
"""
import os
import pytest
import pandas as pd
import great_expectations as ge
from sklearn.model_selection import train_test_split
import config
from pipeline.data import get_clean_data
@pytest... | 27.157143 | 84 | 0.643872 | import os
import pytest
import pandas as pd
import great_expectations as ge
from sklearn.model_selection import train_test_split
import config
from pipeline.data import get_clean_data
@pytest.fixture(scope='session')
def data():
if not os.path.exists(config.DATA_DIR):
pytest.fail(f"Data not ... | true | true |
f772ef8be23cc9110055e8f39051629d5bb2a5f1 | 2,127 | py | Python | OpenStack/openstack_dashboard/dashboards/project/routers/urls.py | ICLOpenStack/NeutronPortForwarding | 96616a76945fd75df16fb25fc47183b35f92744d | [
"Apache-2.0"
] | null | null | null | OpenStack/openstack_dashboard/dashboards/project/routers/urls.py | ICLOpenStack/NeutronPortForwarding | 96616a76945fd75df16fb25fc47183b35f92744d | [
"Apache-2.0"
] | null | null | null | OpenStack/openstack_dashboard/dashboards/project/routers/urls.py | ICLOpenStack/NeutronPortForwarding | 96616a76945fd75df16fb25fc47183b35f92744d | [
"Apache-2.0"
] | null | null | null | # Copyright 2012, Nachi Ueno, NTT MCL, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 37.982143 | 78 | 0.702398 |
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.dashboards.project.routers.extensions.routerrules\
import views as rr_views
from openstack_dashboard.dashboards.project.routers.ports \
import views as port_views
from openstack_dashboard.dashboards.project.routers... | true | true |
f772efc95d16dad9ddd264971e56876fcd676d85 | 1,529 | py | Python | gesso/gesso/api/state.py | machineeeee/builder-python | a01415ef8675e5a11afaa0fe33f794f8ab2a98dc | [
"Apache-2.0"
] | null | null | null | gesso/gesso/api/state.py | machineeeee/builder-python | a01415ef8675e5a11afaa0fe33f794f8ab2a98dc | [
"Apache-2.0"
] | null | null | null | gesso/gesso/api/state.py | machineeeee/builder-python | a01415ef8675e5a11afaa0fe33f794f8ab2a98dc | [
"Apache-2.0"
] | null | null | null | class State(object):
def __init__(self, port=None, state_dict=None):
self.port = port
self.mode = state_dict['mode'] if state_dict is not None else None
self.direction = state_dict['direction'] if state_dict is not None else None
self.voltage = state_dict['voltage'] if state_dict i... | 33.23913 | 110 | 0.616089 | class State(object):
def __init__(self, port=None, state_dict=None):
self.port = port
self.mode = state_dict['mode'] if state_dict is not None else None
self.direction = state_dict['direction'] if state_dict is not None else None
self.voltage = state_dict['voltage'] if state_dict i... | true | true |
f772efdb21643495d0a034e3180b5b44da611834 | 731 | py | Python | core/api/api/redis.py | lkk7/blackjack | 67dc378875f17065017e26ea4503f477dad42d4e | [
"MIT"
] | null | null | null | core/api/api/redis.py | lkk7/blackjack | 67dc378875f17065017e26ea4503f477dad42d4e | [
"MIT"
] | null | null | null | core/api/api/redis.py | lkk7/blackjack | 67dc378875f17065017e26ea4503f477dad42d4e | [
"MIT"
] | null | null | null | import aioredis
from aioredis import Redis
class RedisWrapper:
"""A Redis wrapper class for usage in FastAPI endpoints."""
def __init__(self):
self.conn: Redis = None
async def create_redis(self):
"""Close the connection. Use at server startup."""
self.conn = aioredis.from_url(
... | 25.206897 | 71 | 0.630643 | import aioredis
from aioredis import Redis
class RedisWrapper:
def __init__(self):
self.conn: Redis = None
async def create_redis(self):
self.conn = aioredis.from_url(
"redis://redis", encoding="utf-8", decode_responses=True
)
async def close_redis(self):
awa... | true | true |
f772f0d313019eb5849dd899f97ea4cfc14829e8 | 619 | py | Python | docs/examples/relationships_self_nested.py | angru/datamodel | d242b393970dac1a8a53603454ed870fe70b27cf | [
"MIT"
] | 2 | 2020-06-17T21:00:09.000Z | 2020-07-07T15:49:00.000Z | docs/examples/relationships_self_nested.py | angru/datamodel | d242b393970dac1a8a53603454ed870fe70b27cf | [
"MIT"
] | 14 | 2020-06-17T14:39:19.000Z | 2020-12-25T17:05:43.000Z | docs/examples/relationships_self_nested.py | angru/corm | d242b393970dac1a8a53603454ed870fe70b27cf | [
"MIT"
] | null | null | null | import typing as t
from corm import Storage, Entity, Relationship, Nested
class Item(Entity):
id: int
items: t.List['Item'] = Nested(
entity_type='Item',
back_relation=True,
many=True,
default=list,
)
parent: 'Item' = Relationship(entity_type='Item')
storage = Storag... | 19.967742 | 65 | 0.634895 | import typing as t
from corm import Storage, Entity, Relationship, Nested
class Item(Entity):
id: int
items: t.List['Item'] = Nested(
entity_type='Item',
back_relation=True,
many=True,
default=list,
)
parent: 'Item' = Relationship(entity_type='Item')
storage = Storag... | true | true |
f772f2b44e35483de7fb3aad567f15e6623ce8f9 | 2,107 | py | Python | versebot/regex.py | Matthew-Arnold/slack-versebot | 8ff338063bfcefa24c1055e695803683a032b3d2 | [
"MIT"
] | 13 | 2015-10-26T23:16:51.000Z | 2021-02-14T02:30:33.000Z | versebot/regex.py | Matthew-Arnold/slack-versebot | 8ff338063bfcefa24c1055e695803683a032b3d2 | [
"MIT"
] | 7 | 2015-10-27T01:04:40.000Z | 2021-06-16T04:16:37.000Z | versebot/regex.py | Matthew-Arnold/slack-versebot | 8ff338063bfcefa24c1055e695803683a032b3d2 | [
"MIT"
] | 3 | 2015-11-08T01:21:00.000Z | 2018-11-25T19:11:03.000Z | """
VerseBot for Reddit
By Matthieu Grieger
Continued By Team VerseBot
regex.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
import re
def find_verses(message_body):
""" Uses regex to search comment body for verse quotations. Returns
a list of matches if found, None otherwise.
:param message_bo... | 28.093333 | 76 | 0.612245 |
import re
def find_verses(message_body):
regex = (r"(?<=\[)(?P<book>[\d\w\s]+)\s(?P<chapter>\d+)\:?(?P<verse>\d+"
r"\-?\d*)?\s*\(?(?P<translation>[\w\-\d]+)?\)?(?=\])")
matches = re.findall(regex, message_body)
if len(matches) == 0:
return None
else:
return matches
def... | true | true |
f772f2c626bd71d953b6c8de92949775f3568d34 | 10,900 | py | Python | dpark/moosefs/__init__.py | depexo/DPark-is-a-Python-clone-of-Spark-MapReduce-R- | 9256df88c373c7011a819b8c3ad3b13132d97cd4 | [
"BSD-3-Clause"
] | null | null | null | dpark/moosefs/__init__.py | depexo/DPark-is-a-Python-clone-of-Spark-MapReduce-R- | 9256df88c373c7011a819b8c3ad3b13132d97cd4 | [
"BSD-3-Clause"
] | null | null | null | dpark/moosefs/__init__.py | depexo/DPark-is-a-Python-clone-of-Spark-MapReduce-R- | 9256df88c373c7011a819b8c3ad3b13132d97cd4 | [
"BSD-3-Clause"
] | null | null | null | import os
import socket
from cStringIO import StringIO
import logging
from consts import *
from master import MasterConn
from cs import read_chunk, read_chunk_from_local
MFS_ROOT_INODE = 1
logger = logging.getLogger(__name__)
class CrossSystemSymlink(Exception):
def __init__(self, src, dst):
self.src = ... | 30.193906 | 105 | 0.498349 | import os
import socket
from cStringIO import StringIO
import logging
from consts import *
from master import MasterConn
from cs import read_chunk, read_chunk_from_local
MFS_ROOT_INODE = 1
logger = logging.getLogger(__name__)
class CrossSystemSymlink(Exception):
def __init__(self, src, dst):
self.src = ... | false | true |
f772f427aba4e282073e69dbbfed77b184c2656c | 1,441 | py | Python | zerver/webhooks/gosquared/view.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/gosquared/view.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | 15 | 2020-06-05T18:44:15.000Z | 2022-03-11T23:26:03.000Z | zerver/webhooks/gosquared/view.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.models import UserProfile
... | 43.666667 | 97 | 0.718251 | from __future__ import absolute_import
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
from zerver.models import UserProfile
... | true | true |
f772f59ef72c2165d20b4de837226e54b1dace35 | 3,109 | py | Python | src/poetry/console/commands/plugin/show.py | hadialqattan/poetry | 02444308831358c26595c0f36ea263a3e02cb5d4 | [
"MIT"
] | 2 | 2022-01-15T20:22:15.000Z | 2022-01-16T09:17:11.000Z | src/poetry/console/commands/plugin/show.py | hadialqattan/poetry | 02444308831358c26595c0f36ea263a3e02cb5d4 | [
"MIT"
] | 1 | 2022-02-22T05:52:32.000Z | 2022-02-22T05:52:32.000Z | src/poetry/console/commands/plugin/show.py | hadialqattan/poetry | 02444308831358c26595c0f36ea263a3e02cb5d4 | [
"MIT"
] | 1 | 2022-03-19T12:13:53.000Z | 2022-03-19T12:13:53.000Z | from __future__ import annotations
from collections import defaultdict
from typing import TYPE_CHECKING
from typing import DefaultDict
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from poetry.core.packages.package import Package
class PluginShowCommand(Command):
name = "plugin sh... | 34.932584 | 87 | 0.590544 | from __future__ import annotations
from collections import defaultdict
from typing import TYPE_CHECKING
from typing import DefaultDict
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from poetry.core.packages.package import Package
class PluginShowCommand(Command):
name = "plugin sh... | true | true |
f772f669a70d39a7d4f80663688ecc4d0cce4b35 | 10,003 | py | Python | aerocalc3/val_input.py | geoffreynyaga/aerocalc | ea6a634d6ae4fe6d34c7a65d7867257dfaa4dbb9 | [
"BSD-2-Clause"
] | 1 | 2020-02-26T09:52:46.000Z | 2020-02-26T09:52:46.000Z | aerocalc3/val_input.py | geoffreynyaga/aerocalc | ea6a634d6ae4fe6d34c7a65d7867257dfaa4dbb9 | [
"BSD-2-Clause"
] | null | null | null | aerocalc3/val_input.py | geoffreynyaga/aerocalc | ea6a634d6ae4fe6d34c7a65d7867257dfaa4dbb9 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# #############################################################################
# Copyright (c) 2008, Kevin Horton
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 35.34629 | 100 | 0.535839 |
# Return user input after validating it, offering the user a default value.
# """
def get_input(prompt, type, error_string, check_list=[], default="", **kwds):
input_validated = False
if type == "float":
while not input_validated:
input_data = input(prompt)
try:
... | true | true |
f772f66f4b5e79cc924fb4f966ab2262d0dec4ef | 1,291 | py | Python | Bindings/Python/setup.py | mcx/opensim-core | c109f8cec3a81c732f335cd39752da6ae573b604 | [
"Apache-2.0"
] | 532 | 2015-03-13T18:51:10.000Z | 2022-03-27T08:08:29.000Z | Bindings/Python/setup.py | mcx/opensim-core | c109f8cec3a81c732f335cd39752da6ae573b604 | [
"Apache-2.0"
] | 2,701 | 2015-01-03T21:33:34.000Z | 2022-03-30T07:13:41.000Z | Bindings/Python/setup.py | mcx/opensim-core | c109f8cec3a81c732f335cd39752da6ae573b604 | [
"Apache-2.0"
] | 271 | 2015-02-16T23:25:29.000Z | 2022-03-30T20:12:17.000Z | #!/usr/bin/env python
import os
import sys
from setuptools import setup
# This provides the variable `__version__`.
if sys.version_info[0] < 3:
execfile('opensim/version.py')
else:
exec(compile(open('opensim/version.py').read(), 'opensim/version.py', 'exec'))
setup(name='opensim',
version=__version__,
... | 33.973684 | 82 | 0.617351 |
import os
import sys
from setuptools import setup
if sys.version_info[0] < 3:
execfile('opensim/version.py')
else:
exec(compile(open('opensim/version.py').read(), 'opensim/version.py', 'exec'))
setup(name='opensim',
version=__version__,
description='OpenSim Simulation Framework',
author='Ope... | true | true |
f772f9bbe96e1f8876b174ddadc3294bbbe5cc89 | 842 | py | Python | youtube/urls.py | AryanJassal/YouTubeClone | de74b3b8abcb65a1bb5b118f936a3ce14635a395 | [
"MIT"
] | null | null | null | youtube/urls.py | AryanJassal/YouTubeClone | de74b3b8abcb65a1bb5b118f936a3ce14635a395 | [
"MIT"
] | null | null | null | youtube/urls.py | AryanJassal/YouTubeClone | de74b3b8abcb65a1bb5b118f936a3ce14635a395 | [
"MIT"
] | null | null | null | """youtube URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 35.083333 | 77 | 0.698337 | from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('accounts.urls')),
path('', include('core.urls'))
]
| true | true |
f772fa094e1d79b32ba26319cd35d06e4fa78a92 | 4,603 | py | Python | asreview/webapp/start_flask.py | srmeier/asreview | da77699fc1fa43744fd1bd430834fb5da4f69032 | [
"Apache-2.0"
] | null | null | null | asreview/webapp/start_flask.py | srmeier/asreview | da77699fc1fa43744fd1bd430834fb5da4f69032 | [
"Apache-2.0"
] | null | null | null | asreview/webapp/start_flask.py | srmeier/asreview | da77699fc1fa43744fd1bd430834fb5da4f69032 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 The ASReview 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 appl... | 27.728916 | 74 | 0.658484 |
import logging
import os
import webbrowser
from threading import Timer
from flask import Flask
from flask import send_from_directory
from flask.json import jsonify
from flask.templating import render_template
from flask_cors import CORS
from werkzeug.exceptions import InternalServerError
from asreview import __versi... | true | true |
f772fa14f96609724503b26434a3f0d75e4fd47e | 201 | py | Python | query.py | PrinceMargaret/Search-in-Google | a20f667c4bdef5b181bb6d353a442d1f407c233d | [
"MIT"
] | null | null | null | query.py | PrinceMargaret/Search-in-Google | a20f667c4bdef5b181bb6d353a442d1f407c233d | [
"MIT"
] | null | null | null | query.py | PrinceMargaret/Search-in-Google | a20f667c4bdef5b181bb6d353a442d1f407c233d | [
"MIT"
] | null | null | null | from googlesearch import search
import requests
import webbrowser
def find(question):
url=next(search(question))
webbrowser.open(url)
if __name__=="__main__":
find("apple")
| 20.1 | 32 | 0.686567 | from googlesearch import search
import requests
import webbrowser
def find(question):
url=next(search(question))
webbrowser.open(url)
if __name__=="__main__":
find("apple")
| true | true |
f772fa40d185e43016e128ec1a878aa38d499132 | 765 | py | Python | osquery_rules/osquery_mac_application_firewall.py | panther-labs/panther-cli | 4e5c0a21570e1a02dada990fd91e324416afac96 | [
"MIT"
] | 4 | 2019-10-17T19:33:29.000Z | 2019-10-21T15:23:30.000Z | osquery_rules/osquery_mac_application_firewall.py | jacknagz/panther-analysis | fceab78ba5624136776596ee1b25fa0dc8a02a42 | [
"Apache-2.0"
] | null | null | null | osquery_rules/osquery_mac_application_firewall.py | jacknagz/panther-analysis | fceab78ba5624136776596ee1b25fa0dc8a02a42 | [
"Apache-2.0"
] | null | null | null | from panther_base_helpers import deep_get
QUERIES = {"pack_incident-response_alf", "pack/mac-cis/ApplicationFirewall"}
def rule(event):
if event.get("name") not in QUERIES:
return False
if event.get("action") != "added":
return False
return (
# 0 If the firewall is disabled
... | 29.423077 | 82 | 0.660131 | from panther_base_helpers import deep_get
QUERIES = {"pack_incident-response_alf", "pack/mac-cis/ApplicationFirewall"}
def rule(event):
if event.get("name") not in QUERIES:
return False
if event.get("action") != "added":
return False
return (
int(deep_get... | true | true |
f772fb96f276e4025a3cdc156c44749ee4c0c26f | 2,599 | py | Python | tweetBacktrack.py | Simmons-Wang/easy-backtrack-tweets | d5c7912e06376f63800e76af658a79b87129dc92 | [
"MIT"
] | null | null | null | tweetBacktrack.py | Simmons-Wang/easy-backtrack-tweets | d5c7912e06376f63800e76af658a79b87129dc92 | [
"MIT"
] | null | null | null | tweetBacktrack.py | Simmons-Wang/easy-backtrack-tweets | d5c7912e06376f63800e76af658a79b87129dc92 | [
"MIT"
] | null | null | null | import datetime
import pickle
import tweepy as tp
import pandas as pd
import time
def lookUpDetail(ids):
"""
:param ids: the list of tweets ids, the maximum length is 100 at a time.
:return: dataframe which include 'tweet_id', 'favorite_count', 'retweet_count', 'lang',
'hashtags', 'url', 'user_id'
... | 35.121622 | 111 | 0.648711 | import datetime
import pickle
import tweepy as tp
import pandas as pd
import time
def lookUpDetail(ids):
statuses = api.lookup_statuses(ids)
details = [[i.id, i.favorite_count, i.retweet_count, i.lang,
i.entities['hashtags'], i.entities['urls'],
i.author.id] for i in statuses]
... | true | true |
f772fbaea9e3c468b8ba1bc1a99802364ceb6ded | 930 | py | Python | problems/euler/27/euler_math.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | 1,571 | 2015-12-09T14:08:47.000Z | 2022-03-30T21:34:36.000Z | problems/euler/27/euler_math.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | 117 | 2015-10-22T05:59:19.000Z | 2021-09-17T00:14:38.000Z | problems/euler/27/euler_math.py | vidyadeepa/the-coding-interview | 90171b77b6884176a6c28bdccb5d45bd6929b489 | [
"MIT"
] | 452 | 2015-10-21T23:00:58.000Z | 2022-03-18T21:16:50.000Z | def primes_upto(n):
"""
Sieve of Drathostenes
"""
multiples = set()
yield 2
# Optimization: Add the even numbers
multiples.update(range(4, n, 2))
for p in range(3,n,2):
if p not in multiples:
# Found a prime!
yield p
multiples.update(range(p*2,... | 22.682927 | 73 | 0.502151 | def primes_upto(n):
"""
Sieve of Drathostenes
"""
multiples = set()
yield 2
multiples.update(range(4, n, 2))
for p in range(3,n,2):
if p not in multiples:
yield p
multiples.update(range(p*2, n, p))
def factorize(n, primes):
factors = []
... | false | true |
f772fc1de18cf6ac095683a4182d094c5c0affdd | 3,174 | py | Python | TWE-2/train.py | sysuhu/topical_word_embeddings | 1ae3d15d0afcd3fcd39cc81eec4ad9463413a9f6 | [
"MIT"
] | 330 | 2015-01-28T14:59:06.000Z | 2022-03-24T06:41:29.000Z | TWE-2/train.py | sysuhu/topical_word_embeddings | 1ae3d15d0afcd3fcd39cc81eec4ad9463413a9f6 | [
"MIT"
] | 5 | 2015-12-29T09:29:46.000Z | 2020-08-21T08:58:31.000Z | TWE-2/train.py | sysuhu/topical_word_embeddings | 1ae3d15d0afcd3fcd39cc81eec4ad9463413a9f6 | [
"MIT"
] | 151 | 2015-01-09T04:49:28.000Z | 2022-03-24T06:41:33.000Z | #!/usr/bin/env python2
#-*- coding: UTF-8 -*-
#Author: Yang Liu <largelymfs@gmail.com>
#Description: Topical Word Embedding TWE-2
def generate(input_filename, output_filename, logfile, id2word):
word_label = 0
content2id = {}
id2content = {}
id2number = {}
with open(input_filename) as input:
... | 39.675 | 83 | 0.521424 |
def generate(input_filename, output_filename, logfile, id2word):
word_label = 0
content2id = {}
id2content = {}
id2number = {}
with open(input_filename) as input:
with open(output_filename,"w") as output:
with open(logfile, "w") as log:
for l in input:
... | false | true |
f772fcc968595fc795675ec45e39645f0e951d05 | 4,560 | py | Python | ibis/backends/dask/execution/window.py | rtpsw/ibis | d7318fdf87121cd8fadbcf0369a2b217aab3053a | [
"Apache-2.0"
] | null | null | null | ibis/backends/dask/execution/window.py | rtpsw/ibis | d7318fdf87121cd8fadbcf0369a2b217aab3053a | [
"Apache-2.0"
] | null | null | null | ibis/backends/dask/execution/window.py | rtpsw/ibis | d7318fdf87121cd8fadbcf0369a2b217aab3053a | [
"Apache-2.0"
] | null | null | null | """Code for computing window functions in the dask backend."""
import operator
from typing import Any, Optional, Union
import dask.dataframe as dd
import ibis.expr.operations as ops
import ibis.expr.window as win
from ibis.backends.dask.core import execute, execute_with_scope
from ibis.backends.dask.dispatch import ... | 28.5 | 79 | 0.645395 |
import operator
from typing import Any, Optional, Union
import dask.dataframe as dd
import ibis.expr.operations as ops
import ibis.expr.window as win
from ibis.backends.dask.core import execute, execute_with_scope
from ibis.backends.dask.dispatch import execute_node
from ibis.backends.dask.execution.util import (
... | true | true |
f772fcdac28470e763d79429a04717ea1247f18b | 125 | py | Python | boost/std_pair.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | boost/std_pair.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | boost/std_pair.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
import boost.python
ext = boost.python.import_ext("std_pair_ext")
from std_pair_ext import *
| 25 | 45 | 0.824 | from __future__ import division
import boost.python
ext = boost.python.import_ext("std_pair_ext")
from std_pair_ext import *
| true | true |
f772fcee3f0f58a194fdc7bf8de13bd8e2370c69 | 3,142 | py | Python | userbot/clients/logger.py | UserKontol/Man-Userbot | 82cc97a3aa40fc838cced35c7bdb33e94bb827c8 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/clients/logger.py | UserKontol/Man-Userbot | 82cc97a3aa40fc838cced35c7bdb33e94bb827c8 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/clients/logger.py | UserKontol/Man-Userbot | 82cc97a3aa40fc838cced35c7bdb33e94bb827c8 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Man - UserBot
# Copyright (c) 2022 Man-Userbot
# Credits: @mrismanaziz || https://github.com/mrismanaziz
#
# This file is a part of < https://github.com/mrismanaziz/Man-Userbot/ >
# t.me/SharingUserbot & t.me/Lunatic0de
import asyncio
from telethon.tl.functions.channels import EditAdminRequest, InviteToChannelReque... | 28.825688 | 87 | 0.559835 |
import asyncio
from telethon.tl.functions.channels import EditAdminRequest, InviteToChannelRequest
from telethon.tl.types import ChatAdminRights
from userbot import BOT_VER as version
from userbot import BOTLOG_CHATID
from userbot import CMD_HANDLER as cmd
from userbot import MAN2, MAN3, MAN4, MAN5, bot, branch, tgb... | true | true |
f772fde7193f768ff9e49ab5a36b0a7c3c67d1d7 | 351 | py | Python | docs/examples/basic_post.py | jsandovalc/treq | 72b7b5e67b4517dba6fad138e03a072656c4521a | [
"MIT"
] | 4 | 2016-12-17T09:40:59.000Z | 2020-05-19T19:49:42.000Z | docs/examples/basic_post.py | jsandovalc/treq | 72b7b5e67b4517dba6fad138e03a072656c4521a | [
"MIT"
] | null | null | null | docs/examples/basic_post.py | jsandovalc/treq | 72b7b5e67b4517dba6fad138e03a072656c4521a | [
"MIT"
] | 1 | 2020-11-05T15:58:42.000Z | 2020-11-05T15:58:42.000Z | import asyncio
import json
from _utils import print_response
import aiorequests
def main(*args):
r = yield from aiorequests.post(
'http://httpbin.org/post',
json.dumps({'msg': 'Hello'}),
headers={'Content-Type': 'application/json'})
print((yield from r.text()))
asyncio.get_event_loo... | 20.647059 | 53 | 0.672365 | import asyncio
import json
from _utils import print_response
import aiorequests
def main(*args):
r = yield from aiorequests.post(
'http://httpbin.org/post',
json.dumps({'msg': 'Hello'}),
headers={'Content-Type': 'application/json'})
print((yield from r.text()))
asyncio.get_event_loo... | true | true |
f772fee92614eaa8e41e742c80d0dfa1ec1bb1ab | 240 | py | Python | variabledeclaration.py | iceboy07/Python_proj | 4565bfd148722731a6b87ffedc8b6473528a22bb | [
"MIT"
] | null | null | null | variabledeclaration.py | iceboy07/Python_proj | 4565bfd148722731a6b87ffedc8b6473528a22bb | [
"MIT"
] | null | null | null | variabledeclaration.py | iceboy07/Python_proj | 4565bfd148722731a6b87ffedc8b6473528a22bb | [
"MIT"
] | null | null | null | a=5 #variable declaration (5 is assigned to variable a)
print(a,"is a type of", type(a)) #type(a)--> command is used to identify the type of variable 'a' here
b=7.5
print(b,"is a type of", type(b))
c="hello"
print(c,"is a type of", type(c)) | 40 | 102 | 0.675 | a=5 print(a,"is a type of", type(a)) b=7.5
print(b,"is a type of", type(b))
c="hello"
print(c,"is a type of", type(c)) | true | true |
f77300b51b7142ed365ead9fd068c3c576fd727d | 10,904 | py | Python | conans/model/conan_file.py | rukgar/conan | 02e0e1718da20d67348761fe24a39110f70b1664 | [
"MIT"
] | null | null | null | conans/model/conan_file.py | rukgar/conan | 02e0e1718da20d67348761fe24a39110f70b1664 | [
"MIT"
] | null | null | null | conans/model/conan_file.py | rukgar/conan | 02e0e1718da20d67348761fe24a39110f70b1664 | [
"MIT"
] | null | null | null | import os
from contextlib import contextmanager
from conans import tools # @UnusedImport KEEP THIS! Needed for pyinstaller to copy to exe.
from conans.client.tools.env import pythonpath
from conans.errors import ConanException
from conans.model.build_info import DepsCppInfo
from conans.model.env_info import DepsEnvIn... | 37.861111 | 100 | 0.642058 | import os
from contextlib import contextmanager
from conans import tools from conans.client.tools.env import pythonpath
from conans.errors import ConanException
from conans.model.build_info import DepsCppInfo
from conans.model.env_info import DepsEnvInfo, EnvValues
from conans.model.options import Options, PackageOpt... | true | true |
f77300cf83903b1fb42a3e80d7c50375afb68943 | 6,556 | py | Python | analysis/source_match.py | xparedesfortuny/Phot | 761c77bf8a03e90112dd790b5824c682c2597996 | [
"MIT"
] | 1 | 2016-11-18T17:06:09.000Z | 2016-11-18T17:06:09.000Z | analysis/source_match.py | ivxa/Phot | 761c77bf8a03e90112dd790b5824c682c2597996 | [
"MIT"
] | null | null | null | analysis/source_match.py | ivxa/Phot | 761c77bf8a03e90112dd790b5824c682c2597996 | [
"MIT"
] | 2 | 2016-11-12T04:42:59.000Z | 2016-11-18T17:06:10.000Z | # Author: Xavier Paredes-Fortuny (xparedesfortuny@gmail.com)
# License: MIT, see LICENSE.md
import sys
import numpy as np
from astropy.coordinates import SkyCoord
from astropy import units as u
import itertools
param = {}
execfile(sys.argv[1])
def find_target(ra, dec, ra0, dec0, fl, testing=0):
tar = SkyCoord(r... | 39.733333 | 158 | 0.601739 |
import sys
import numpy as np
from astropy.coordinates import SkyCoord
from astropy import units as u
import itertools
param = {}
execfile(sys.argv[1])
def find_target(ra, dec, ra0, dec0, fl, testing=0):
tar = SkyCoord(ra0, dec0, unit=(u.hour, u.deg))
cat = SkyCoord(ra*u.degree, dec*u.degree)
ind, sep2d... | false | true |
f77300e0e6f8f9bb65cb28d8d2afe83da21e9f9c | 606 | py | Python | adduser.py | hydrogen18/fairywren | 2d99c9bd3a645bf7be1a8e14d4afce30513aceaa | [
"MIT"
] | 39 | 2015-04-02T10:54:24.000Z | 2021-12-17T04:01:37.000Z | adduser.py | hydrogen18/fairywren | 2d99c9bd3a645bf7be1a8e14d4afce30513aceaa | [
"MIT"
] | null | null | null | adduser.py | hydrogen18/fairywren | 2d99c9bd3a645bf7be1a8e14d4afce30513aceaa | [
"MIT"
] | 21 | 2015-03-24T13:58:23.000Z | 2021-06-08T11:26:24.000Z | import vanilla
import psycopg2
import sys
import json
import hashlib
import base64
import users
import getpass
if __name__ == "__main__":
with open(sys.argv[1],'r') as fin:
conf = json.load(fin)
connPool = vanilla.buildConnectionPool(psycopg2,**conf['webapi']['postgresql'])
u = users.Users(conf['salt'])
u.setCo... | 19.548387 | 80 | 0.717822 | import vanilla
import psycopg2
import sys
import json
import hashlib
import base64
import users
import getpass
if __name__ == "__main__":
with open(sys.argv[1],'r') as fin:
conf = json.load(fin)
connPool = vanilla.buildConnectionPool(psycopg2,**conf['webapi']['postgresql'])
u = users.Users(conf['salt'])
u.setCo... | true | true |
f7730424d0d972760d201d85d800d902bd48d590 | 6,323 | py | Python | src/tests/global_variables/env_variables_defaults.py | nirarg/assisted-test-infra | e07c43501c1d9bfaa1aee3aea49f1ef359faee07 | [
"Apache-2.0"
] | null | null | null | src/tests/global_variables/env_variables_defaults.py | nirarg/assisted-test-infra | e07c43501c1d9bfaa1aee3aea49f1ef359faee07 | [
"Apache-2.0"
] | null | null | null | src/tests/global_variables/env_variables_defaults.py | nirarg/assisted-test-infra | e07c43501c1d9bfaa1aee3aea49f1ef359faee07 | [
"Apache-2.0"
] | null | null | null | from abc import ABC
from dataclasses import dataclass
from distutils.util import strtobool
from pathlib import Path
import consts
from assisted_test_infra.test_infra.utils.env_var import EnvVar
from consts import env_defaults, resources
from triggers.env_trigger import DataPool
@dataclass(frozen=True)
class _EnvVari... | 59.650943 | 118 | 0.758026 | from abc import ABC
from dataclasses import dataclass
from distutils.util import strtobool
from pathlib import Path
import consts
from assisted_test_infra.test_infra.utils.env_var import EnvVar
from consts import env_defaults, resources
from triggers.env_trigger import DataPool
@dataclass(frozen=True)
class _EnvVari... | true | true |
f77304e8468266d80435822a94ee777c5635784e | 3,415 | py | Python | tests/test_sessions.py | igor-simoes/metadata_parser | 88fda041a7a65c9ca88c24ca515073219921b254 | [
"MIT"
] | null | null | null | tests/test_sessions.py | igor-simoes/metadata_parser | 88fda041a7a65c9ca88c24ca515073219921b254 | [
"MIT"
] | null | null | null | tests/test_sessions.py | igor-simoes/metadata_parser | 88fda041a7a65c9ca88c24ca515073219921b254 | [
"MIT"
] | null | null | null | # stdlib
import unittest
# pypi
from httpbin import app as httpbin_app
import pytest_httpbin.serve
import requests
# local
import metadata_parser
# ==============================================================================
class SessionRedirect(requests.Session):
num_checked = None
def get_redirect_ta... | 37.527473 | 88 | 0.612592 | import unittest
from httpbin import app as httpbin_app
import pytest_httpbin.serve
import requests
import metadata_parser
class SessionRedirect(requests.Session):
num_checked = None
def get_redirect_target(self, resp):
def _get():
if self.num_checked is None:
... | true | true |
f77306c7663f61eb34a46bff6106480434dfa4ae | 313 | py | Python | homework1/main.py | ehytig/Python_And_DeepLearning | b8316d09d961de4611ed1e98ea5297dfb06d30e4 | [
"MIT"
] | null | null | null | homework1/main.py | ehytig/Python_And_DeepLearning | b8316d09d961de4611ed1e98ea5297dfb06d30e4 | [
"MIT"
] | null | null | null | homework1/main.py | ehytig/Python_And_DeepLearning | b8316d09d961de4611ed1e98ea5297dfb06d30e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from utils import paper
web_url = "https://www.nature.com/articles/s41586-021-03359-9"
pdf_directory = r"G:\\Test_Download_paper\\PDF"
ris_directory = r"G:\\Test_Download_paper\\RIS"
paper1 = paper(web_url, pdf_directory= pdf_directory, ris_directory= ris_directory)
paper1.download() | 28.454545 | 83 | 0.750799 |
from utils import paper
web_url = "https://www.nature.com/articles/s41586-021-03359-9"
pdf_directory = r"G:\\Test_Download_paper\\PDF"
ris_directory = r"G:\\Test_Download_paper\\RIS"
paper1 = paper(web_url, pdf_directory= pdf_directory, ris_directory= ris_directory)
paper1.download() | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.