hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64b5fd679988d6740cfa11831e571513bb2efecd | 21,927 | py | Python | instancehandler/views.py | TCSOSM-20/LW-UI | 70c3331278f71d3b22fc3a090d526b4b8106d155 | [
"Apache-2.0"
] | null | null | null | instancehandler/views.py | TCSOSM-20/LW-UI | 70c3331278f71d3b22fc3a090d526b4b8106d155 | [
"Apache-2.0"
] | null | null | null | instancehandler/views.py | TCSOSM-20/LW-UI | 70c3331278f71d3b22fc3a090d526b4b8106d155 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 CNIT - Consorzio Nazionale Interuniversitario per le Telecomunicazioni
#
# 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/LICE... | 47.771242 | 130 | 0.585671 |
09cbc3e122baea74dc6e7e211bdf43133d2ae3b1 | 5,337 | py | Python | MoneyTracker/purchases.py | albert-dinh-01/MoneyTracker | 855145dbb9842096a70bef43c8c6431e8d04c7fe | [
"MIT"
] | null | null | null | MoneyTracker/purchases.py | albert-dinh-01/MoneyTracker | 855145dbb9842096a70bef43c8c6431e8d04c7fe | [
"MIT"
] | null | null | null | MoneyTracker/purchases.py | albert-dinh-01/MoneyTracker | 855145dbb9842096a70bef43c8c6431e8d04c7fe | [
"MIT"
] | null | null | null | """
Author: Albert Dinh
Date: Oct 13, 2020
This file contains the basic template for
certain goods classes.
"""
from datetime import datetime, date
class BasicPurchases:
def __init__(self, price, onoff, item_name):
self.__time_stamp = date.today().strftime("%B %d, %Y")
self.__da... | 30.323864 | 86 | 0.579914 |
aa46b477ee9aabfa34c1730fc8ca5f905bc112c8 | 418 | py | Python | tools/add_all_cohorts_to_teacher.py | simonchristensen1/Zeeguu-Core | 76f0e4a73676e00e6023ccbb2017210982670da2 | [
"MIT"
] | 1 | 2018-03-22T12:29:49.000Z | 2018-03-22T12:29:49.000Z | tools/add_all_cohorts_to_teacher.py | simonchristensen1/Zeeguu-Core | 76f0e4a73676e00e6023ccbb2017210982670da2 | [
"MIT"
] | 82 | 2017-12-09T16:15:02.000Z | 2020-11-12T11:34:09.000Z | tools/add_all_cohorts_to_teacher.py | simonchristensen1/Zeeguu-Core | 76f0e4a73676e00e6023ccbb2017210982670da2 | [
"MIT"
] | 9 | 2017-11-25T11:32:05.000Z | 2020-10-26T15:50:13.000Z | #!/usr/bin/env python
"""
Script that lists recent users
To be called from a cron job.
"""
import zeeguu_core
from zeeguu_core.model import User, Cohort, TeacherCohortMap
session = zeeguu_core.db.session
big_teacher = User.query.filter_by(id=534).one()
for cohort in Cohort.query.all():
mapping = Teacher... | 19.904762 | 75 | 0.746411 |
f044e345713dd7cdf17ec894fcaa78d631a74c26 | 1,223 | py | Python | matchms/importing/load_from_usi.py | sdrogers/matchms | 1ce16b45ca218fb86b4d6c24cf7dc338045f5cc1 | [
"Apache-2.0"
] | null | null | null | matchms/importing/load_from_usi.py | sdrogers/matchms | 1ce16b45ca218fb86b4d6c24cf7dc338045f5cc1 | [
"Apache-2.0"
] | null | null | null | matchms/importing/load_from_usi.py | sdrogers/matchms | 1ce16b45ca218fb86b4d6c24cf7dc338045f5cc1 | [
"Apache-2.0"
] | null | null | null | import json
import numpy as np
import requests
from matchms import Spectrum
def load_from_usi(usi: str, server='https://metabolomics-usi.ucsd.edu'):
"""Load spectrum from metabolomics USI.
USI returns JSON data with keys 'peaks', 'n_peaks' and 'precuror_mz'
Args:
----
usi: str
Provide the us... | 24.959184 | 74 | 0.626329 |
dc28e1adc57950d2a43e7e91d62b2937b4dcca4f | 1,424 | py | Python | sandbox/lib/jumpscale/JumpscaleLibs/clients/gitea/GiteaMilestones.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/JumpscaleLibs/clients/gitea/GiteaMilestones.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 117 | 2019-09-01T11:59:19.000Z | 2020-07-14T11:10:08.000Z | sandbox/lib/jumpscale/JumpscaleLibs/clients/gitea/GiteaMilestones.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 2 | 2020-04-06T15:21:23.000Z | 2020-05-07T04:29:53.000Z | from Jumpscale import j
from .GiteaMilestone import GiteaMilestone
JSBASE = j.baseclasses.object
class GiteaMilestones(j.baseclasses.object):
def __init__(self, client, repo, user):
JSBASE.__init__(self)
self.client = client
self.repo = repo
self.user = user
self.position... | 29.061224 | 110 | 0.572331 |
9fea3c352334c559cc051120cefdb84c20062945 | 2,415 | py | Python | Tools/TextProcess.py | camille1874/FinQA | 5e99cdee44e88a494c4cf6127c5c127ac80ab4db | [
"Apache-2.0"
] | null | null | null | Tools/TextProcess.py | camille1874/FinQA | 5e99cdee44e88a494c4cf6127c5c127ac80ab4db | [
"Apache-2.0"
] | null | null | null | Tools/TextProcess.py | camille1874/FinQA | 5e99cdee44e88a494c4cf6127c5c127ac80ab4db | [
"Apache-2.0"
] | null | null | null | #coding:utf8
import jieba
import jieba.posseg as pseg
import os,sys
'''
initialize jieba Segment
'''
def jieba_initialize():
jieba.load_userdict(os.path.dirname(os.path.split(os.path.realpath(__file__))[0])+'/resources/QAattrdic.txt')
jieba.initialize()
'''
Segment words by jieba
'''
def wordSegment(text):
... | 19.795082 | 113 | 0.541201 |
f4ab16fb93bd95e7490f31adb4487814378d740d | 17,657 | py | Python | batchglm/unit_test/test_acc_glm_all_tf2.py | le-ander/batchglm | 31b905b99b6baa7c94b82550d6a74f00d81966ea | [
"BSD-3-Clause"
] | null | null | null | batchglm/unit_test/test_acc_glm_all_tf2.py | le-ander/batchglm | 31b905b99b6baa7c94b82550d6a74f00d81966ea | [
"BSD-3-Clause"
] | null | null | null | batchglm/unit_test/test_acc_glm_all_tf2.py | le-ander/batchglm | 31b905b99b6baa7c94b82550d6a74f00d81966ea | [
"BSD-3-Clause"
] | null | null | null | import logging
import numpy as np
import scipy.sparse
import unittest
import batchglm.api as glm
glm.setup_logging(verbosity="WARNING", stream="STDOUT")
logger = logging.getLogger(__name__)
class _TestAccuracyGlmAllEstim:
def __init__(
self,
simulator,
quick_scale,
... | 33.632381 | 100 | 0.574107 |
a9a61b31229bbca11e83f25b7d5b253cc7473a55 | 114 | py | Python | pynuit/_enums.py | louisdevie/pynuit | 4add2277529be8f577457202da6146f722c03caf | [
"MIT"
] | null | null | null | pynuit/_enums.py | louisdevie/pynuit | 4add2277529be8f577457202da6146f722c03caf | [
"MIT"
] | null | null | null | pynuit/_enums.py | louisdevie/pynuit | 4add2277529be8f577457202da6146f722c03caf | [
"MIT"
] | null | null | null | from enum import Enum
__all__ = ["Alignment"]
class Alignment(Enum):
LEFT = 1
RIGHT = 2
CENTER = 3
| 11.4 | 23 | 0.614035 |
b84db1f338fde3c3386860f1001420ec26f4d160 | 1,769 | py | Python | yat-master/pymodule/yat/test/data_generator.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | yat-master/pymodule/yat/test/data_generator.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | yat-master/pymodule/yat/test/data_generator.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/env python
# encoding=utf-8
"""
Copyright (c) 2021 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFT... | 28.532258 | 84 | 0.610514 |
9c74f8eb6bceda188dd46722c8d72a8d13992dff | 2,005 | py | Python | pysyte/cli/streams.py | git-wwts/pysyte | 625658138cdb5affc1a6a89a9f2c7e3667ee80c2 | [
"MIT"
] | 1 | 2021-11-10T15:24:36.000Z | 2021-11-10T15:24:36.000Z | pysyte/cli/streams.py | git-wwts/pysyte | 625658138cdb5affc1a6a89a9f2c7e3667ee80c2 | [
"MIT"
] | 12 | 2020-01-15T00:19:41.000Z | 2021-05-11T14:52:04.000Z | pysyte/cli/streams.py | git-wwts/pysyte | 625658138cdb5affc1a6a89a9f2c7e3667ee80c2 | [
"MIT"
] | 2 | 2015-01-31T11:51:06.000Z | 2015-01-31T21:29:19.000Z | """Module to handle streams of text from cli arguments"""
import os
import sys
from six import StringIO
from pysyte import iteration
from pysyte.cli import arguments
from pysyte.oss.platforms import get_clipboard_data
def parse_args():
"""Parse out command line arguments"""
parser = arguments.parser(__doc_... | 24.156627 | 73 | 0.640898 |
e4e24a9e93ed4fec68be1e2bef39f17a070e0095 | 9,536 | py | Python | Overlap_Case/py_analysis/plot_microenvs.py | furkankurtoglu/whole-well | cbafce776256f1a78ca52141a365f4690601c339 | [
"BSD-3-Clause"
] | null | null | null | Overlap_Case/py_analysis/plot_microenvs.py | furkankurtoglu/whole-well | cbafce776256f1a78ca52141a365f4690601c339 | [
"BSD-3-Clause"
] | null | null | null | Overlap_Case/py_analysis/plot_microenvs.py | furkankurtoglu/whole-well | cbafce776256f1a78ca52141a365f4690601c339 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 27 14:41:55 2021
@author: Furkan
"""
import importlib.machinery
pyMCDS = importlib.machinery.SourceFileLoader('pyMCDS','./analysis/pyMCDS.py').load_module()
import os.path
from os import path
from pathlib import Path
import matplotlib.pyplot as plt
import matplotlib.... | 31.681063 | 132 | 0.604761 |
6bcbe98eeec1d5c4bbab52dd539e3877dde5367c | 3,309 | py | Python | ros_radar_mine/neuro_learning/controller/evol_main/evol_main_ANN.py | tudelft/blimp_snn | 23acbef8822337387aee196a3a10854e82bb4f80 | [
"Apache-2.0"
] | 3 | 2021-11-08T20:20:21.000Z | 2021-12-29T09:05:37.000Z | ros_radar_mine/neuro_learning/controller/evol_main/evol_main_ANN.py | tudelft/blimp_snn | 23acbef8822337387aee196a3a10854e82bb4f80 | [
"Apache-2.0"
] | null | null | null | ros_radar_mine/neuro_learning/controller/evol_main/evol_main_ANN.py | tudelft/blimp_snn | 23acbef8822337387aee196a3a10854e82bb4f80 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 30 17:41:45 2021
@author: marina
"""
# Set absolute package path
import sys, os
sys.path.append(os.path.abspath(".."))
import torch
import array
import numpy as np
import random
import copy
import matplotlib.pyplot as plt
import pandas as pd
from ... | 32.126214 | 225 | 0.668782 |
0e39ee85c4f49a03591b8e56bfbe3a2012baf902 | 5,193 | py | Python | ojos_ca/domain/value_object/binary/core.py | ojos/python-ca | dba9e9c61fd997c8c2ed60a6bd6f076c5f216265 | [
"MIT"
] | null | null | null | ojos_ca/domain/value_object/binary/core.py | ojos/python-ca | dba9e9c61fd997c8c2ed60a6bd6f076c5f216265 | [
"MIT"
] | null | null | null | ojos_ca/domain/value_object/binary/core.py | ojos/python-ca | dba9e9c61fd997c8c2ed60a6bd6f076c5f216265 | [
"MIT"
] | null | null | null | import base64
import re
from typing import Any
from ojos_ca.domain.value_object.core import IsInstance
class Binary(IsInstance):
CLASS_INFO = bytes
@property
def base64(self) -> str:
return base64.b64encode(self.value).decode()
def pre_set(self, value: Any):
if value is None:
... | 34.164474 | 159 | 0.569998 |
b2b309dcee406c56131a3698a26a7b4095c8d363 | 2,143 | py | Python | tottle/types/objects/chat.py | muffleo/tottle | 69a5bdda879ab56d43505d517d3369a687c135a2 | [
"MIT"
] | 12 | 2020-09-06T15:31:34.000Z | 2021-02-27T20:30:34.000Z | tottle/types/objects/chat.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 2 | 2021-04-13T06:43:42.000Z | 2021-07-07T20:52:39.000Z | tottle/types/objects/chat.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 4 | 2020-09-12T03:09:25.000Z | 2021-03-22T08:52:04.000Z | from typing import Optional
from pydantic import BaseModel
from tottle.types.objects.user import User
class ChatPhoto(BaseModel):
small_file_id: Optional[str] = None
small_file_unique_id: Optional[str] = None
big_file_id: Optional[str] = None
big_file_unique_id: Optional[str] = None
class ChatPermi... | 33.484375 | 52 | 0.722818 |
dc0b010bf0bb5bb0495b49ea59ff4f9704fcdbeb | 2,083 | py | Python | experiments/state_distance/iclr2018/ant_distance_3_to_5.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/state_distance/iclr2018/ant_distance_3_to_5.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/state_distance/iclr2018/ant_distance_3_to_5.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | from rlkit.misc.data_processing import Experiment
import matplotlib.pyplot as plt
import numpy as np
from rlkit.misc.visualization_util import sliding_mean
def main():
tdm_trials = Experiment(
"/home/vitchyr/git/railrl/data/doodads3/01-02-ddpg-tdm-ant-nupo-sweep/",
criteria={
'exp_id'... | 30.188406 | 80 | 0.571771 |
2f00fe0d16c59791bfebd29338977740406a12ed | 1,488 | py | Python | test.py | ahwhbc/LookIntoPerson | 448cb265b4a834c678cbcabe9c7f5c2a68de20dc | [
"MIT"
] | 79 | 2018-06-27T07:58:51.000Z | 2022-03-18T08:55:50.000Z | test.py | ahwhbc/LookIntoPerson | 448cb265b4a834c678cbcabe9c7f5c2a68de20dc | [
"MIT"
] | 6 | 2018-08-07T14:35:31.000Z | 2022-03-26T02:21:32.000Z | test.py | ahwhbc/LookIntoPerson | 448cb265b4a834c678cbcabe9c7f5c2a68de20dc | [
"MIT"
] | 19 | 2018-07-18T08:36:58.000Z | 2021-03-05T03:20:18.000Z | # import the necessary packages
import argparse
import os
import cv2 as cv
import keras.backend as K
import numpy as np
from config import num_classes
from data_generator import random_choice, safe_crop, to_bgr
from model import build_model
if __name__ == '__main__':
# Parse arguments
ap = argparse.ArgumentP... | 26.571429 | 78 | 0.668683 |
e99e63e70be655cf48b17ba6f3eaea700c5ae0c0 | 279 | py | Python | dynamic_progamme/__init__.py | tianyuningmou/Algorithm | 30b52da686cf037133488de0068a2d8739a210e2 | [
"MIT"
] | 1 | 2018-04-11T14:40:33.000Z | 2018-04-11T14:40:33.000Z | dynamic_progamme/__init__.py | tianyuningmou/Algorithm | 30b52da686cf037133488de0068a2d8739a210e2 | [
"MIT"
] | null | null | null | dynamic_progamme/__init__.py | tianyuningmou/Algorithm | 30b52da686cf037133488de0068a2d8739a210e2 | [
"MIT"
] | 1 | 2018-03-21T14:01:59.000Z | 2018-03-21T14:01:59.000Z | # -*- coding: utf-8 -*-
"""
Copyright () 2018
All rights reserved
FILE: __init__.py.py
AUTHOR: tianyuningmou
DATE CREATED: @Time : 2018/3/12 上午11:54
DESCRIPTION: .
VERSION: : #1
CHANGED By: : tianyuningmou
CHANGE: :
MODIFIED: : @Time : 2018/3/12 上午11:54
"""
# 动态规划的问题
| 13.285714 | 40 | 0.65233 |
bf538f7c7880d7a8d2c56c3951262c1aa4a67ded | 46,203 | py | Python | src/prefect/client/client.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/prefect/client/client.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/prefect/client/client.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import datetime
import json
import os
import re
import uuid
import warnings
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Union
from urllib.parse import urljoin
import pendulum
import toml
import time
from slugify import slugify
import prefect
from prefect.utilities... | 36.180893 | 160 | 0.552064 |
501339b8d673885c749fd1421c34050899a6cefa | 2,031 | py | Python | package/fast_svd.py | AyoubBelhadji/random_matrix_factorization | 44ee6cd01b1d3f5d70d8392b3b7c1ccdb93e2d89 | [
"MIT"
] | null | null | null | package/fast_svd.py | AyoubBelhadji/random_matrix_factorization | 44ee6cd01b1d3f5d70d8392b3b7c1ccdb93e2d89 | [
"MIT"
] | null | null | null | package/fast_svd.py | AyoubBelhadji/random_matrix_factorization | 44ee6cd01b1d3f5d70d8392b3b7c1ccdb93e2d89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 12 11:45:41 2017
@author: ayoubbelhadji1
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.pyplot
from scipy.stats import chi2
import pylab as mp
### Parameters
N = 1000 # Number of points
d = 2 # Dimension
s_n = 10 # Nu... | 34.423729 | 131 | 0.742491 |
14aeb5f61da104831d8ff04ebbafa904dbe340af | 1,709 | py | Python | Sprint_Challenge/aq_dashboard.py | hughjafro/DS-Unit-3-Sprint-4-Productization-and-Cloud | b14b6779b02db7585ec5d9d6e741c7d53b555741 | [
"MIT"
] | null | null | null | Sprint_Challenge/aq_dashboard.py | hughjafro/DS-Unit-3-Sprint-4-Productization-and-Cloud | b14b6779b02db7585ec5d9d6e741c7d53b555741 | [
"MIT"
] | null | null | null | Sprint_Challenge/aq_dashboard.py | hughjafro/DS-Unit-3-Sprint-4-Productization-and-Cloud | b14b6779b02db7585ec5d9d6e741c7d53b555741 | [
"MIT"
] | null | null | null | """OpenAQ Air Quality Dashboard with Flask."""
from flask import Flask, render_template, request
from flask_sqlalchemy import SQLAlchemy
import openaq
"""Create and configure an instance of the flask app"""
APP = Flask(__name__)
api = openaq.OpenAQ()
APP.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3'
APP.... | 31.072727 | 79 | 0.680515 |
e6f277ff8747c830839ca30e23e75460fbb325b0 | 62,042 | py | Python | no_rendering_mode.py | aleallievi/scenario_runner | 3744fc15dadf169cfa25e3192fb2257a5ec3b557 | [
"MIT"
] | 447 | 2021-03-26T09:29:17.000Z | 2022-03-30T03:03:35.000Z | no_rendering_mode.py | aleallievi/scenario_runner | 3744fc15dadf169cfa25e3192fb2257a5ec3b557 | [
"MIT"
] | 56 | 2021-04-21T03:12:50.000Z | 2022-03-30T13:34:16.000Z | no_rendering_mode.py | aleallievi/scenario_runner | 3744fc15dadf169cfa25e3192fb2257a5ec3b557 | [
"MIT"
] | 82 | 2021-04-14T04:34:04.000Z | 2022-03-29T07:35:15.000Z | #!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Allows visualising a 2D map generated by vehicles.
"""
Welcome to CARLA No... | 41.499666 | 130 | 0.563151 |
3f5bb894a0d45f017022d6ce7677f45d51047df3 | 3,384 | py | Python | parse_location_history.py | palmdalian/parse-location-history | 4c03976884824bd42c5ff36f2ca1207d966d1c50 | [
"BSD-3-Clause"
] | null | null | null | parse_location_history.py | palmdalian/parse-location-history | 4c03976884824bd42c5ff36f2ca1207d966d1c50 | [
"BSD-3-Clause"
] | null | null | null | parse_location_history.py | palmdalian/parse-location-history | 4c03976884824bd42c5ff36f2ca1207d966d1c50 | [
"BSD-3-Clause"
] | null | null | null | import sys, os, json, datetime, time, xml.dom.minidom
from decimal import *
from optparse import OptionParser
parser = OptionParser(usage='usage: %prog [-f | --file] inputJSON [-s | --start] month/day/year [-e | --end] month/day/year [-o | --output] outputKML')
parser.add_option("-s", "--start", action="store", type="s... | 40.771084 | 165 | 0.70656 |
9d0d100373bebc70103a51bc4c0f2e34bf41daef | 3,122 | py | Python | google/cloud/iot/v1/iot-v1-py/google/cloud/iot_v1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/iot/v1/iot-v1-py/google/cloud/iot_v1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/iot/v1/iot-v1-py/google/cloud/iot_v1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 27.628319 | 74 | 0.741832 |
f20d2cd5e758caa42d89cc293f5b4c3b3604c378 | 3,215 | py | Python | alljoyn/services/controlpanel/cpp/tools/CPSAppGenerator/GeneratorUtils/containerWidget.py | octoblu/alljoyn | a74003fa25af1d0790468bf781a4d49347ec05c4 | [
"ISC"
] | 37 | 2015-01-18T21:27:23.000Z | 2018-01-12T00:33:43.000Z | alljoyn/services/controlpanel/cpp/tools/CPSAppGenerator/GeneratorUtils/containerWidget.py | octoblu/alljoyn | a74003fa25af1d0790468bf781a4d49347ec05c4 | [
"ISC"
] | 14 | 2015-02-24T11:44:01.000Z | 2020-07-20T18:48:44.000Z | alljoyn/services/controlpanel/cpp/tools/CPSAppGenerator/GeneratorUtils/containerWidget.py | octoblu/alljoyn | a74003fa25af1d0790468bf781a4d49347ec05c4 | [
"ISC"
] | 29 | 2015-01-23T16:40:52.000Z | 2019-10-21T12:22:30.000Z | # Copyright AllSeen Alliance. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AN... | 44.041096 | 140 | 0.661586 |
8164375a191b18a0b4496e5ada3ce9d7b2538fa1 | 3,834 | py | Python | insights/parsers/tests/test_hammer_ping.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 1 | 2020-02-19T06:36:22.000Z | 2020-02-19T06:36:22.000Z | insights/parsers/tests/test_hammer_ping.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | 10 | 2018-04-16T15:38:04.000Z | 2018-05-15T18:43:02.000Z | insights/parsers/tests/test_hammer_ping.py | mglantz/insights-core | 6f20bbbe03f53ee786f483b2a28d256ff1ad0fd4 | [
"Apache-2.0"
] | null | null | null | from insights.parsers.hammer_ping import HammerPing
from insights.tests import context_wrap
HAMMERPING_ERR_1 = """
Error: Connection refused - connect(2) for "localhost" port 443
"""
HAMMERPING_ERR_2 = """
Could not load the API description from the server
- is the server down?
- was 'foreman-rake apipie:cache' run... | 30.428571 | 138 | 0.701617 |
fdaf461cd99168c39df3093f83e366e1f08176d7 | 12,163 | py | Python | examples/libtest/StringTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 739 | 2015-01-01T02:05:11.000Z | 2022-03-30T15:26:16.000Z | examples/libtest/StringTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 33 | 2015-03-25T23:17:04.000Z | 2021-08-19T08:25:22.000Z | examples/libtest/StringTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 167 | 2015-01-01T22:27:47.000Z | 2022-03-17T13:29:19.000Z | # -*- coding: utf-8 -*-
from UnitTest import UnitTest
import write
class StringTest(UnitTest):
def testBasestring(self):
s = 'A string'
self.assertTrue(isinstance(s, str), "isinstance(s, str)")
self.assertTrue(isinstance(s, basestring), "isinstance(s, basestring)")
def testToString(se... | 35.460641 | 152 | 0.559648 |
0f50f0f9cdfef21a54ffa6a0b78cca439552fdbd | 1,797 | py | Python | Bank ATM Application/Python_ATM_Bank_App.py | KelvinBrannonJr/Python-Applications | 5efe8c4d149db4feda6ef3e019cef4ab9d912c64 | [
"MIT"
] | null | null | null | Bank ATM Application/Python_ATM_Bank_App.py | KelvinBrannonJr/Python-Applications | 5efe8c4d149db4feda6ef3e019cef4ab9d912c64 | [
"MIT"
] | null | null | null | Bank ATM Application/Python_ATM_Bank_App.py | KelvinBrannonJr/Python-Applications | 5efe8c4d149db4feda6ef3e019cef4ab9d912c64 | [
"MIT"
] | null | null | null | class Bank_Account:
account_balance = 0
amount = 0
name = input("Enter your name: ")
def __init__(self,starting_amount = 0.00):
self.account_balance = starting_amount
def deposit_funds(self):
pass
def withdraw_funds(self):
pass
def transaction_history(sel... | 32.089286 | 86 | 0.679466 |
34a7ecfee9507180fa66e6c79b180eacc1e9e3e4 | 1,331 | py | Python | run/sestoft.py | lrecht/ParadigmComparison | 4bf8d5f90241b569b57266146dc64ba844d5c774 | [
"MIT"
] | null | null | null | run/sestoft.py | lrecht/ParadigmComparison | 4bf8d5f90241b569b57266146dc64ba844d5c774 | [
"MIT"
] | 8 | 2020-10-13T07:07:58.000Z | 2020-12-14T12:55:03.000Z | run/sestoft.py | lrecht/ParadigmComparison | 4bf8d5f90241b569b57266146dc64ba844d5c774 | [
"MIT"
] | null | null | null | from run.cochran import run_benchmark
from . import benchmark_utils as bm_utils
import subprocess
#Performs the list of benchmarks and saves to results to output csv file
def perform_benchmarks(benchmarks, experiment_iterations, output_file):
statistics, csv_output = bm_utils.setup(output_file)
benchmark_count... | 39.147059 | 114 | 0.682945 |
76c694e30ac59ee1c185c8a7818ead80bc2f57ff | 6,443 | py | Python | app/main/views/letter_branding.py | alphagov-mirror/notifications-admin | 04d051df6b85cf596a7d6d0f28474b04673e420a | [
"MIT"
] | null | null | null | app/main/views/letter_branding.py | alphagov-mirror/notifications-admin | 04d051df6b85cf596a7d6d0f28474b04673e420a | [
"MIT"
] | 3 | 2021-03-31T19:52:53.000Z | 2021-12-13T20:39:53.000Z | app/main/views/letter_branding.py | alphagov-mirror/notifications-admin | 04d051df6b85cf596a7d6d0f28474b04673e420a | [
"MIT"
] | null | null | null | from botocore.exceptions import ClientError as BotoClientError
from flask import (
current_app,
redirect,
render_template,
request,
session,
url_for,
)
from notifications_python_client.errors import HTTPError
from app import letter_branding_client
from app.main import main
from app.main.forms i... | 35.794444 | 106 | 0.680118 |
5c15351b18b5f02802d7663526a574b0aebfe40c | 3,569 | py | Python | tatk/policy/mle/camrest/camrest_data_loader.py | yqzhangthu/tatk | 4d27e89604a33f19f1c7b8fe5dc92d4ba6c6f10a | [
"Apache-2.0"
] | null | null | null | tatk/policy/mle/camrest/camrest_data_loader.py | yqzhangthu/tatk | 4d27e89604a33f19f1c7b8fe5dc92d4ba6c6f10a | [
"Apache-2.0"
] | null | null | null | tatk/policy/mle/camrest/camrest_data_loader.py | yqzhangthu/tatk | 4d27e89604a33f19f1c7b8fe5dc92d4ba6c6f10a | [
"Apache-2.0"
] | null | null | null | import os
import json
import pickle
import zipfile
import torch
import torch.utils.data as data
from tatk.util.camrest.state import default_state
from tatk.policy.vector.vector_camrest import CamrestVector
class PolicyDataLoaderCamrest():
def __init__(self):
root_dir = os.path.dirname(os.path.dirname(... | 38.793478 | 129 | 0.546091 |
3ba6bb1db4bdca300d540025b3523289595b01e6 | 7,706 | py | Python | qcodes_contrib_drivers/drivers/Attocube/ANC300sim.py | ThorstenGroh/Qcodes_contrib_drivers | 97e05f8f5d8762953ee9db9bc461d0814eef657d | [
"MIT"
] | 1 | 2021-12-03T18:04:57.000Z | 2021-12-03T18:04:57.000Z | qcodes_contrib_drivers/drivers/Attocube/ANC300sim.py | ThorstenGroh/Qcodes_contrib_drivers | 97e05f8f5d8762953ee9db9bc461d0814eef657d | [
"MIT"
] | 2 | 2020-05-29T11:00:52.000Z | 2020-10-09T06:18:11.000Z | qcodes_contrib_drivers/drivers/Attocube/ANC300sim.py | ThorstenGroh/Qcodes_contrib_drivers | 97e05f8f5d8762953ee9db9bc461d0814eef657d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""QCoDeS- Simulation for the Attocube ANC300 controller.
Simulation for the Attocube ANC300 driver in the same way as it is used in our lab.
Author:
Michael Wagener, FZJ / ZEA-2, m.wagener@fz-juelich.de
"""
import pyvisa
from qcodes.instrument.visa import VisaInstrument
# if set to True... | 36.009346 | 87 | 0.47171 |
2c6dea30ba3dccbc726b623d2eb54b6359949ded | 4,673 | py | Python | brainscore/metrics/xarray_utils.py | dmayo/brain-score | 3ab4258152c9e3f8c7d29afb10158b184dbcebbe | [
"MIT"
] | 52 | 2019-12-13T06:43:44.000Z | 2022-02-21T07:47:39.000Z | brainscore/metrics/xarray_utils.py | dmayo/brain-score | 3ab4258152c9e3f8c7d29afb10158b184dbcebbe | [
"MIT"
] | 104 | 2019-12-06T18:08:54.000Z | 2022-03-31T23:57:51.000Z | brainscore/metrics/xarray_utils.py | dmayo/brain-score | 3ab4258152c9e3f8c7d29afb10158b184dbcebbe | [
"MIT"
] | 32 | 2019-12-05T14:31:14.000Z | 2022-03-10T02:04:45.000Z | import numpy as np
from brainio.assemblies import NeuroidAssembly, array_is_element, walk_coords
from brainscore.metrics import Score
class Defaults:
expected_dims = ('presentation', 'neuroid')
stimulus_coord = 'image_id'
neuroid_dim = 'neuroid'
neuroid_coord = 'neuroid_id'
class XarrayRegression:
... | 47.20202 | 120 | 0.685641 |
42579d11e62e618d7714ee977cd4e5d990c7bb3d | 520 | py | Python | pykeyset/core/profile/__init__.py | staticintlucas/pykeyset | 8581252c85dfceebe22926af4640164a0895e7a0 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-06T16:43:25.000Z | 2021-07-06T16:43:25.000Z | pykeyset/core/profile/__init__.py | staticintlucas/pykeyset | 8581252c85dfceebe22926af4640164a0895e7a0 | [
"Apache-2.0",
"MIT"
] | null | null | null | pykeyset/core/profile/__init__.py | staticintlucas/pykeyset | 8581252c85dfceebe22926af4640164a0895e7a0 | [
"Apache-2.0",
"MIT"
] | null | null | null | import os.path
from pathlib import Path
from ... import resources
from .load import load_builtin, load_file
from .profile import Profile
__all__ = ["Profile", "load_builtin", "load_file"]
# TODO this function is used by the cmdlist parser. Move it somewhere more appropriate?
def load(ctx, file):
"""load a built... | 27.368421 | 87 | 0.717308 |
d5b0d5f0441aaf583d4c8a98676a868e10f282c4 | 5,337 | py | Python | social-tags/src/data/delicious_t140.py | queirozfcom/auto-tagger | d9c0339648562ceca2d7cd10a02aaf56d353ae7b | [
"MIT"
] | null | null | null | social-tags/src/data/delicious_t140.py | queirozfcom/auto-tagger | d9c0339648562ceca2d7cd10a02aaf56d353ae7b | [
"MIT"
] | 1 | 2016-02-19T03:08:47.000Z | 2016-02-19T03:08:47.000Z | social-tags/src/data/delicious_t140.py | queirozfcom/auto-tagger | d9c0339648562ceca2d7cd10a02aaf56d353ae7b | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import xml.etree.ElementTree as ET
from joblib import Parallel, delayed
import pickle
import os
import gc
from src.helpers.labels import filter_tag, truncate_labels
from src.helpers.delicious_t140 import load_contents, make_path_to_file
from src.features.delicious_t140 import cle... | 38.956204 | 148 | 0.681469 |
81f481a81e3b98d4fc468b81817b74141b40b6ca | 1,560 | py | Python | src/generate_makeshift_hood.py | hirmiura/cdda-mod-Yararezon | 41bda74d6196fbac3e67ef326dde7d65e3e8daf9 | [
"MIT"
] | 1 | 2021-09-28T17:53:06.000Z | 2021-09-28T17:53:06.000Z | src/generate_makeshift_hood.py | hirmiura/cdda-mod-Yararezon | 41bda74d6196fbac3e67ef326dde7d65e3e8daf9 | [
"MIT"
] | null | null | null | src/generate_makeshift_hood.py | hirmiura/cdda-mod-Yararezon | 41bda74d6196fbac3e67ef326dde7d65e3e8daf9 | [
"MIT"
] | 1 | 2021-09-28T17:53:08.000Z | 2021-09-28T17:53:08.000Z | #!/usr/bin/env -S python
# -*- coding: utf-8 -*-
import io
import json
import sys
from cdda_gettext import gt
# MSYS2での文字化け対策
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
hood_prefix = 'makeshift_hood'
# フードの素材のIDリスト
compos = [
'sheet',
'blanket',
'down_blanket',
'fur_blanket'... | 21.369863 | 66 | 0.532692 |
f0a7ad27736f97d85e9936b4fdb7a6a7ad85843f | 3,877 | py | Python | week1/utilities/click_models.py | gsingers/search_with_machine_learning_course | 94622c24eb07e52793cf5e2289f2f69359bb87af | [
"Apache-2.0"
] | 11 | 2021-12-30T18:55:56.000Z | 2022-03-15T17:33:10.000Z | week1/utilities/click_models.py | gsingers/search_with_machine_learning_course | 94622c24eb07e52793cf5e2289f2f69359bb87af | [
"Apache-2.0"
] | 9 | 2021-12-31T05:24:33.000Z | 2022-03-08T07:44:45.000Z | week1/utilities/click_models.py | gsingers/search_with_machine_learning_course | 94622c24eb07e52793cf5e2289f2f69359bb87af | [
"Apache-2.0"
] | 127 | 2021-12-24T17:03:26.000Z | 2022-03-13T17:20:21.000Z | # Implements various click models
import pandas as pd
import numpy as np
def binary_func(x):
if x > 0:
return 1
return 0
def step(x):
if x < 0.05: return 0
elif x >= 0.05 and x < 0.10: return 0.5
elif x >= 0.10 and x < 0.3: return 0.75
else: return 1
# Given a click model type, trans... | 50.350649 | 162 | 0.681713 |
2e78ccf25ae5c623060572a172cb80502b1b4d34 | 5,061 | py | Python | okex/context.py | bopo/okex | 55107b4b6e02b0aa0d24003d095e118f7fc51f4b | [
"BSD-2-Clause"
] | 10 | 2017-12-14T15:28:33.000Z | 2021-07-04T13:00:14.000Z | okex/context.py | bopo/okex | 55107b4b6e02b0aa0d24003d095e118f7fc51f4b | [
"BSD-2-Clause"
] | 1 | 2018-05-26T11:20:40.000Z | 2018-06-11T07:11:34.000Z | okex/context.py | bopo/okex | 55107b4b6e02b0aa0d24003d095e118f7fc51f4b | [
"BSD-2-Clause"
] | 5 | 2018-01-29T03:44:31.000Z | 2018-11-15T10:08:33.000Z | # -*- coding: utf-8 -*-
CONTRACT_TYPE = ('this_week', 'next_week', 'quarter')
SYMBOLS = ('btc_usd', 'ltc_usd', 'ltc_btc')
TYPES = ('1min', '3min', '5min', '15min', '30min', '1day', '3day', '1week', '1hour', '2hour',
'4hour', '6hour', '12hour')
ENDPOINT = {
'ticker': ('/api/v1/{}ticker.do', 'get'),
'de... | 29.946746 | 93 | 0.562735 |
762f30d1bd634ff9cae7704cf73ecd8fd7f1a5f7 | 733 | py | Python | bookstore_project/urls.py | SumnanAzadi/django-professional | 445b519dcae848e92f14b908c89e15ee8c2ff870 | [
"MIT"
] | null | null | null | bookstore_project/urls.py | SumnanAzadi/django-professional | 445b519dcae848e92f14b908c89e15ee8c2ff870 | [
"MIT"
] | null | null | null | bookstore_project/urls.py | SumnanAzadi/django-professional | 445b519dcae848e92f14b908c89e15ee8c2ff870 | [
"MIT"
] | null | null | null | from django.conf import settings # new
from django.conf.urls.static import static # new
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
# Django admin
path('anything-but-admin/', admin.site.urls),
# User management
path('accounts/', include('allauth.urls')), # ... | 31.869565 | 65 | 0.672578 |
305cfb340cdae00823f040d3b7a2c91fdb100972 | 2,799 | py | Python | nb2page.py | dfdazac/nb2page | ffec71a2176875fc85849d137d6ba1e43327d215 | [
"MIT"
] | null | null | null | nb2page.py | dfdazac/nb2page | ffec71a2176875fc85849d137d6ba1e43327d215 | [
"MIT"
] | 2 | 2018-10-02T08:15:02.000Z | 2018-10-02T08:35:07.000Z | nb2page.py | dfdazac/nb2page | ffec71a2176875fc85849d137d6ba1e43327d215 | [
"MIT"
] | null | null | null | from sys import argv
import os
import datetime
import shutil
ASSETS_PATH = 'assets/img/'
POSTS_PATH = '_posts/'
# Read header with front matter, MathJax settings, etc.
with open('header.txt') as file:
header = file.read()
# Read markdown body
nb_path = argv[1]
nb_name = os.path.basename(nb_path)
name = os.path.s... | 32.929412 | 113 | 0.645588 |
c59f808c6715c704e036bb3390f56e1011e095c9 | 545 | py | Python | app/__init__.py | OmegaM/story | 421c457bc121d6ca418468199108da7bd9f96435 | [
"BSD-3-Clause"
] | null | null | null | app/__init__.py | OmegaM/story | 421c457bc121d6ca418468199108da7bd9f96435 | [
"BSD-3-Clause"
] | null | null | null | app/__init__.py | OmegaM/story | 421c457bc121d6ca418468199108da7bd9f96435 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Created with Pycharm IDEA
@Create on 2015/9/12 16:30
@my_story __init__.py.py
@author : OmegaMiao"""
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from config import config
loginManager = LoginManager(... | 18.793103 | 43 | 0.765138 |
6037afbb32c94f56c41b4f9d3134ae40bfd05406 | 456 | py | Python | Medium/merge.py | a-shah8/LeetCode | a654e478f51b2254f7b49055beba6b5675bc5223 | [
"MIT"
] | 1 | 2021-06-02T15:03:41.000Z | 2021-06-02T15:03:41.000Z | Medium/merge.py | a-shah8/LeetCode | a654e478f51b2254f7b49055beba6b5675bc5223 | [
"MIT"
] | null | null | null | Medium/merge.py | a-shah8/LeetCode | a654e478f51b2254f7b49055beba6b5675bc5223 | [
"MIT"
] | null | null | null | ## Sort first
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
intervals.sort(key=lambda x: x[0])
merged = []
for interval in intervals:
if not merged or merged[-1][1] < interval[0]:
merged.ap... | 25.333333 | 67 | 0.464912 |
72c9ebd15d8a8f99f977783108eb41c203a61579 | 6,002 | py | Python | short_lived_tokens/endec/engine.py | FriedBotStudio/short_lived_tokens | dd823cfd81ae6e211f9281826bb367a8fcb6fd5a | [
"MIT"
] | null | null | null | short_lived_tokens/endec/engine.py | FriedBotStudio/short_lived_tokens | dd823cfd81ae6e211f9281826bb367a8fcb6fd5a | [
"MIT"
] | null | null | null | short_lived_tokens/endec/engine.py | FriedBotStudio/short_lived_tokens | dd823cfd81ae6e211f9281826bb367a8fcb6fd5a | [
"MIT"
] | null | null | null | import abc
from short_lived_tokens.endec.time_utils import get_timestamp_ms, in_range
import zlib
from abc import ABCMeta
import base64
from typing import Tuple
class EndecEngine(metaclass=ABCMeta):
"""Abstract Class `EndecEngine` can be used to define custom Encryption and Decryption Engine as per this Endec Spe... | 35.94012 | 143 | 0.646618 |
cb0b3559e2cfa105cb9f44beafec5d3319868764 | 704 | py | Python | snapshotServer/migrations/0005_auto_20200408_1537.py | bhecquet/seleniumRobot-server | b5930a21a25d63f2071dd57a55855b62808800d1 | [
"Apache-2.0"
] | null | null | null | snapshotServer/migrations/0005_auto_20200408_1537.py | bhecquet/seleniumRobot-server | b5930a21a25d63f2071dd57a55855b62808800d1 | [
"Apache-2.0"
] | 95 | 2017-05-04T09:00:52.000Z | 2022-03-11T23:19:20.000Z | snapshotServer/migrations/0005_auto_20200408_1537.py | bhecquet/seleniumRobot-server | b5930a21a25d63f2071dd57a55855b62808800d1 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-08 13:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('snapshotServer', '0004_auto_20200320_1059'),
]
operations = [
migrations.AddField(
... | 28.16 | 140 | 0.609375 |
e4365a83b2780a111ca1f22c463048c0fd75c8f0 | 673 | py | Python | Lintcode/Ladder_59_A1806/1481. Unique Substring.py | ctc316/algorithm-python | ac4580d55e05e93e407c6156c9bb801808027d60 | [
"MIT"
] | null | null | null | Lintcode/Ladder_59_A1806/1481. Unique Substring.py | ctc316/algorithm-python | ac4580d55e05e93e407c6156c9bb801808027d60 | [
"MIT"
] | null | null | null | Lintcode/Ladder_59_A1806/1481. Unique Substring.py | ctc316/algorithm-python | ac4580d55e05e93e407c6156c9bb801808027d60 | [
"MIT"
] | null | null | null | # Version 1: hash, Time: O(n * k + mlogm for sorting)
class Solution:
"""
@param s: a string
@param k: an integer
@return: all unique substring
"""
def uniqueSubstring(self, s, k):
records = set()
for i in range(len(s) - k + 1):
word = s[i: i + k]
if word ... | 24.035714 | 75 | 0.534918 |
246778ce6a68256846f394047a07cd94ffea56c8 | 771 | py | Python | programmers/Lv3/12.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | 1 | 2022-01-16T19:57:28.000Z | 2022-01-16T19:57:28.000Z | programmers/Lv3/12.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | null | null | null | programmers/Lv3/12.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | null | null | null | # https://programmers.co.kr/learn/courses/30/lessons/42628?language=python3
import heapq
def solution(operations):
min_heap = []
max_heap = []
for op in operations:
o1,o2 = op.split(" ")
if o1 == "I":
heapq.heappush(min_heap,int(o2))
heapq.heappush(max_heap... | 28.555556 | 75 | 0.526589 |
7c63464420f071408bff99dc9995594087b726c7 | 3,978 | py | Python | thsr_voice_reminder/app_settings.py | sc420/thsr-voice-reminder | 1112d02905cfcc5738b8da32eb34e72fb31b5f61 | [
"MIT"
] | null | null | null | thsr_voice_reminder/app_settings.py | sc420/thsr-voice-reminder | 1112d02905cfcc5738b8da32eb34e72fb31b5f61 | [
"MIT"
] | null | null | null | thsr_voice_reminder/app_settings.py | sc420/thsr-voice-reminder | 1112d02905cfcc5738b8da32eb34e72fb31b5f61 | [
"MIT"
] | null | null | null | import yaml
from thsr_voice_reminder.base import Base
class AppSettings(Base):
def __init__(self, args):
super().__init__(self, args)
self._init_settings_state()
def has_settings_changed(self):
return self._has_settings_changed
def iterate_schedule_items(self):
for sche... | 28.212766 | 76 | 0.621418 |
4b1fea97a53d399f6ba16e116d9bd0ab87b1007e | 724 | py | Python | Notakto/Result.py | oalieno/Notakto | e32d4a8cc2e9a91eadd30d3a0a972f1dd67666bb | [
"MIT"
] | 5 | 2018-01-02T13:29:02.000Z | 2019-12-30T04:10:36.000Z | Notakto/Result.py | OAlienO/Notakto | e32d4a8cc2e9a91eadd30d3a0a972f1dd67666bb | [
"MIT"
] | 1 | 2021-10-30T12:42:50.000Z | 2021-10-30T12:42:50.000Z | Notakto/Result.py | OAlienO/Notakto | e32d4a8cc2e9a91eadd30d3a0a972f1dd67666bb | [
"MIT"
] | null | null | null | from .constants import BOARD_TEMPLATE
class Result:
def __init__(self, status, index, x, y):
self.status = status
self.index = index
self.x = x
self.y = y
@property
def move(self):
return (self.index, self.x, self.y)
def __repr__(self):
return "Result({... | 28.96 | 103 | 0.542818 |
93ba97d9afb5355b5ffa7dae9f866a1aabdb2f9c | 783 | py | Python | Sample03_schematic_io.py | CMA2401PT/BDXWorkShop | b42e8d72a6e19ed7d3ee12c3c2469472cc62c690 | [
"MIT"
] | null | null | null | Sample03_schematic_io.py | CMA2401PT/BDXWorkShop | b42e8d72a6e19ed7d3ee12c3c2469472cc62c690 | [
"MIT"
] | null | null | null | Sample03_schematic_io.py | CMA2401PT/BDXWorkShop | b42e8d72a6e19ed7d3ee12c3c2469472cc62c690 | [
"MIT"
] | null | null | null | import os
from canvas import IR
from canvas import irio
input_schematic_file = 'data/城市书店1.schematic'
ir_in_bdx = 'data/silo.bdx'
output_bdx_file = 'output/sample03/output.bdx'
output_schematic_file = 'output/sample03/output_schematic.schematic'
output_bdx_file_converted_from_bdx = 'output/sample03/from_bdx.schematic'... | 35.590909 | 73 | 0.83014 |
94cd12460a7094869c210b2b361c84840922d435 | 2,933 | py | Python | src/video_processor.py | artemlunev2000/winter-road-detection | 5ad20a404e1dd2940a22bbd7e8b82425d8b1a782 | [
"Apache-2.0"
] | null | null | null | src/video_processor.py | artemlunev2000/winter-road-detection | 5ad20a404e1dd2940a22bbd7e8b82425d8b1a782 | [
"Apache-2.0"
] | null | null | null | src/video_processor.py | artemlunev2000/winter-road-detection | 5ad20a404e1dd2940a22bbd7e8b82425d8b1a782 | [
"Apache-2.0"
] | null | null | null | from cv2 import waitKey, destroyAllWindows, line, LINE_8, bitwise_and, cvtColor, COLOR_BGR2GRAY, \
threshold, THRESH_BINARY, dilate, imshow, VideoCapture
import numpy as np
from src.frame_processor import process_frame
from src.frame_preprocessor import preprocess_frame
def detect_hood_ending(images):
... | 31.537634 | 99 | 0.522332 |
e906c70feb4946ad6b0b9447591cf55da06e75b4 | 940 | py | Python | 010_functions/calculator.py | rafael-torraca/python-100-days-of-code | 3a5b3e32c5a3fd66a4fd726d378e0d2f746a3f30 | [
"MIT"
] | null | null | null | 010_functions/calculator.py | rafael-torraca/python-100-days-of-code | 3a5b3e32c5a3fd66a4fd726d378e0d2f746a3f30 | [
"MIT"
] | null | null | null | 010_functions/calculator.py | rafael-torraca/python-100-days-of-code | 3a5b3e32c5a3fd66a4fd726d378e0d2f746a3f30 | [
"MIT"
] | null | null | null | from os import system
from art import logo
def add(n1, n2):
return n1 + n2
def subtract(n1, n2):
return n1 - n2
def multiply(n1, n2):
return n1 * n2
def divide(n1, n2):
return n1 / n2
operations = {
"+": add,
"-": subtract,
"*": multiply,
"/": divide
}
def calculator():
print(logo)
num1 = flo... | 21.363636 | 113 | 0.643617 |
1c72380ff608ba818fe91fa149246a01fddb7071 | 9,919 | py | Python | getProxy.py | solomonxie/autohotkey | c77587b5065d0f91cf951175554d2c38cae42f96 | [
"MIT"
] | null | null | null | getProxy.py | solomonxie/autohotkey | c77587b5065d0f91cf951175554d2c38cae42f96 | [
"MIT"
] | null | null | null | getProxy.py | solomonxie/autohotkey | c77587b5065d0f91cf951175554d2c38cae42f96 | [
"MIT"
] | null | null | null | # Python2
# coding:utf-8
'''
# Title : proxy
# Author: Solomon Xie
# Usage :
# Notes :
# Update:
'''
# === 必备模块 ===
import urllib2, urllib, re, os, sys, time, random, datetime, getopt
import requests # 第三方
from threading import Thread
from bs4 import BeautifulSoup # 第三方
def ma... | 47.917874 | 199 | 0.52475 |
f7904ee21c6148a588edb6d7483f529f1af85bcb | 1,365 | py | Python | src/scripts/roam_with_joy.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 24 | 2021-09-10T23:35:53.000Z | 2022-03-31T18:12:20.000Z | src/scripts/roam_with_joy.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 4 | 2021-12-11T06:56:58.000Z | 2022-02-23T03:05:00.000Z | src/scripts/roam_with_joy.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 7 | 2021-12-17T14:13:27.000Z | 2022-03-31T16:39:28.000Z | import argparse
from src.roamers.joy_habitat_roamer import JoyHabitatRoamer
def main():
# parse input arguments
parser = argparse.ArgumentParser()
parser.add_argument("--launch-file-path", default="launch/teleop.launch", type=str)
parser.add_argument(
"--hab-env-node-path", default="src/nodes/... | 31.022727 | 87 | 0.683516 |
4ecc52a195ed40ad93a0d1fcd935da734316172d | 1,498 | py | Python | rchabro/users/tests/test_views.py | Digbigpig/rchabro | 8c8af557443f81fa8dab91e57829e20f98d2759f | [
"MIT"
] | null | null | null | rchabro/users/tests/test_views.py | Digbigpig/rchabro | 8c8af557443f81fa8dab91e57829e20f98d2759f | [
"MIT"
] | null | null | null | rchabro/users/tests/test_views.py | Digbigpig/rchabro | 8c8af557443f81fa8dab91e57829e20f98d2759f | [
"MIT"
] | null | null | null | import pytest
from django.conf import settings
from django.test import RequestFactory
from rchabro.users.views import UserRedirectView, UserUpdateView
pytestmark = pytest.mark.django_db
class TestUserUpdateView:
"""
TODO:
extracting view initialization code as class-scoped fixture
would be g... | 28.264151 | 77 | 0.6749 |
ec6ede8545dc74f97c00f40055e25a8e80d1cc8b | 34,562 | py | Python | badwords/profanity_filter.py | Jeyhun023/python | aec0ba266543d52d7cecf49221fe38eafaf50e09 | [
"MIT"
] | null | null | null | badwords/profanity_filter.py | Jeyhun023/python | aec0ba266543d52d7cecf49221fe38eafaf50e09 | [
"MIT"
] | null | null | null | badwords/profanity_filter.py | Jeyhun023/python | aec0ba266543d52d7cecf49221fe38eafaf50e09 | [
"MIT"
] | null | null | null | import re
from collections import defaultdict
from contextlib import suppress, contextmanager
from copy import deepcopy
from itertools import chain
from math import floor
from pathlib import Path
from typing import Dict, Union, List, Tuple, Set, Collection, ContextManager, Optional
import poetry_version
import spacy
i... | 42.827757 | 119 | 0.634714 |
d44b6639550bc06702135a7f8addef958bc84ac6 | 3,534 | py | Python | src/cone/app/browser/utils.py | lenadax/cone.app | b25c55aedb85e45a962003d2767a22a927cc61c0 | [
"BSD-3-Clause"
] | null | null | null | src/cone/app/browser/utils.py | lenadax/cone.app | b25c55aedb85e45a962003d2767a22a927cc61c0 | [
"BSD-3-Clause"
] | null | null | null | src/cone/app/browser/utils.py | lenadax/cone.app | b25c55aedb85e45a962003d2767a22a927cc61c0 | [
"BSD-3-Clause"
] | null | null | null | from cone.app import compat
from cone.app.utils import app_config
from cone.app.utils import format_traceback as _format_traceback
from cone.app.utils import safe_encode
from cone.app.utils import safe_decode
from pyramid.i18n import TranslationStringFactory
import copy
import datetime
import re
_ = TranslationString... | 28.272 | 79 | 0.624222 |
0deac2c1cb47006d1e5e2a3c51d681581edd71bc | 245 | py | Python | Python/Python (Basic) Skills Certification Test/average_function.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | 1 | 2021-05-19T06:44:03.000Z | 2021-05-19T06:44:03.000Z | Python/Python (Basic) Skills Certification Test/average_function.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | null | null | null | Python/Python (Basic) Skills Certification Test/average_function.py | paurav11/HackerRank | 80c91c5cc55dd56671a5906be7a106ad4f1db95e | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
def avg(*nums):
return sum(nums)/len(nums)
if __name__ == '__main__':
nums = list(map(int, input().split()))
res = avg(*nums)
print('%.2f' % res + '\n')
| 14.411765 | 42 | 0.612245 |
4584d84f19f96559416e608dde6bbfa3740afe3a | 12,804 | py | Python | notebooks/py/ISS.py | haoxusci/starfish | d7bd856024c75f2ce41504406f2a663566c3814b | [
"MIT"
] | null | null | null | notebooks/py/ISS.py | haoxusci/starfish | d7bd856024c75f2ce41504406f2a663566c3814b | [
"MIT"
] | null | null | null | notebooks/py/ISS.py | haoxusci/starfish | d7bd856024c75f2ce41504406f2a663566c3814b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
#
# EPY: stripped_notebook: {"metadata": {"hide_input": false, "kernelspec": {"display_name": "starfish", "language": "python", "name": "starfish"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name":... | 38.682779 | 643 | 0.757888 |
a933188e69d4d39029422f9d527706adcbd78f9f | 361 | py | Python | sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/__init__.py | conniey/azure-sdk-for-python | f779de8e53dbec033f98f976284e6d9491fd60b3 | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/__init__.py | conniey/azure-sdk-for-python | f779de8e53dbec033f98f976284e6d9491fd60b3 | [
"MIT"
] | null | null | null | sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/__init__.py | conniey/azure-sdk-for-python | f779de8e53dbec033f98f976284e6d9491fd60b3 | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from ._vers... | 40.111111 | 75 | 0.459834 |
4b5ee738464976d35f4bd59dcc56491308ce5fa9 | 22,723 | py | Python | services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | null | null | null | services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | 29 | 2018-11-13T09:39:29.000Z | 2022-03-22T10:11:32.000Z | services/director-v2/tests/unit/with_dbs/test_modules_comp_scheduler_dask_scheduler.py | mguidon/osparc-simcore | 77e64777728f20a5b21362372aefa0e0db5072cd | [
"MIT"
] | null | null | null | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=no-value-for-parameter
# pylint:disable=protected-access
# pylint:disable=too-many-arguments
# pylint:disable=no-name-in-module
from typing import Any, Callable, Dict, Iterator, cast
from unittest i... | 37.558678 | 119 | 0.727545 |
d41f91d80fc61cf2f337b280da24bae254309672 | 994 | py | Python | souspi/tests/unit_poc/temp_test.py | jrheling/souspi | d4f35ad868172aeba4d68287ab3d101dd05b48e2 | [
"Apache-2.0"
] | null | null | null | souspi/tests/unit_poc/temp_test.py | jrheling/souspi | d4f35ad868172aeba4d68287ab3d101dd05b48e2 | [
"Apache-2.0"
] | 26 | 2015-01-24T13:44:04.000Z | 2016-07-14T11:15:39.000Z | souspi/tests/unit_poc/temp_test.py | jrheling/souspi | d4f35ad868172aeba4d68287ab3d101dd05b48e2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# trivial test driver to show operation of DS18B20 sensor on raspi
#
# wiring:
#
# blue / black lead from DS18B20 to GND
# yellow lead (data) from DS18B20 to BCM port #4 on RPi
# - also have resistor (~4.7k-10k) to 3.3v
# red led from DS18B20 to 3.3V
# software prereq
# python pac... | 30.121212 | 89 | 0.749497 |
9ad9fea0df06b390266e8ae36abcc8a232e5bdc8 | 387 | py | Python | tests/test_swagger_jmx.py | QAInsights/swaggerjmx | 29308c8b2cdcf33819a9681aa669ab57cfbc88c7 | [
"MIT"
] | 1 | 2021-08-20T08:04:31.000Z | 2021-08-20T08:04:31.000Z | tests/test_swagger_jmx.py | QAInsights/swaggerjmx | 29308c8b2cdcf33819a9681aa669ab57cfbc88c7 | [
"MIT"
] | null | null | null | tests/test_swagger_jmx.py | QAInsights/swaggerjmx | 29308c8b2cdcf33819a9681aa669ab57cfbc88c7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from swaggerjmx.convert import conversion
from swaggerjmx.settings import Settings as ST
path = os.path.join(os.getcwd(), 'test.json')
ST.swagger_url_json_path = '/home/travis/build/Pactortester/swaggerjmx/tests/test.json'
# ST.swagger_url_json_path = 'test.json'
# ST.swagger_url = '... | 29.769231 | 87 | 0.749354 |
e013fb43f02b12c0c4d9bf417b14c194a42dbf9d | 6,184 | py | Python | robogen/rgkit/backup bots/kamikaze112213.py | andrewgailey/robogen | 7e96cfa26d2e6dc383c5d205816ddd98f8f100d7 | [
"Unlicense"
] | null | null | null | robogen/rgkit/backup bots/kamikaze112213.py | andrewgailey/robogen | 7e96cfa26d2e6dc383c5d205816ddd98f8f100d7 | [
"Unlicense"
] | null | null | null | robogen/rgkit/backup bots/kamikaze112213.py | andrewgailey/robogen | 7e96cfa26d2e6dc383c5d205816ddd98f8f100d7 | [
"Unlicense"
] | null | null | null | # kamikaze112213 by hephaestus
# http://robotgame.org/viewrobot/5830
import rg
import operator
class Robot:
def act(self, game):
adjacent_robots = self.get_adjacent_robots(game)
adjacent_friendlies = self.get_adjacent_robots(game, operator.__eq__)
adjacent_enemies = self.get_adjacent_robo... | 44.171429 | 116 | 0.619825 |
3735a3a8f0c659f6b7a3e47ade5c1d09eb477d15 | 7,464 | py | Python | tests/test_io.py | mabudz/pyam | ac64c7194c36b796ae473cae47c2917d3848e5bb | [
"Apache-2.0"
] | 2 | 2017-12-07T06:17:00.000Z | 2018-03-05T09:09:42.000Z | tests/test_io.py | shaohuizhang/pyam | 2dffec07ce86b2f3fb8133ac369fa3c172589064 | [
"Apache-2.0"
] | 29 | 2017-12-06T21:52:53.000Z | 2018-03-05T10:41:46.000Z | tests/test_io.py | shaohuizhang/pyam | 2dffec07ce86b2f3fb8133ac369fa3c172589064 | [
"Apache-2.0"
] | 8 | 2017-12-07T09:07:49.000Z | 2018-02-26T07:55:16.000Z | from pathlib import Path
import pandas as pd
import numpy as np
import pytest
from pyam import IamDataFrame, read_datapackage
from pyam.utils import META_IDX
from pyam.testing import assert_iamframe_equal
from .conftest import TEST_DATA_DIR, META_DF
FILTER_ARGS = dict(scenario="scen_a")
def test_data_none():
#... | 33.621622 | 88 | 0.704984 |
10413af077b8d64c5d74324bd462260c5791f740 | 214,633 | py | Python | Mi Lenguaje/MyLanguage/lib/python3.8/site-packages/mypy/checkexpr.py | DataEngel/Creando-mi-primer-lenguaje-de-programaci-n- | 92434f89c62b6cec0114441c669952450ba21b79 | [
"MIT"
] | 6 | 2020-04-10T14:36:25.000Z | 2021-04-25T13:11:32.000Z | Mi Lenguaje/MyLanguage/lib/python3.8/site-packages/mypy/checkexpr.py | DataEngel/Creando-mi-primer-lenguaje-de-programaci-n- | 92434f89c62b6cec0114441c669952450ba21b79 | [
"MIT"
] | null | null | null | Mi Lenguaje/MyLanguage/lib/python3.8/site-packages/mypy/checkexpr.py | DataEngel/Creando-mi-primer-lenguaje-de-programaci-n- | 92434f89c62b6cec0114441c669952450ba21b79 | [
"MIT"
] | null | null | null | """Expression type checker. This file is conceptually part of TypeChecker."""
from collections import OrderedDict
from contextlib import contextmanager
import itertools
from typing import (
Any, cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator
)
from typing_extensions import ClassVar, Fi... | 49.036555 | 99 | 0.591577 |
4f3c10a39331f5b35babea089ba49dcc80c627a1 | 22,910 | py | Python | ML_AI/PyTorch/Enet_PyTorch.py | KeerthanaPravallika/OpenOctober | e93c120c90ce6c298b7052a2f7759560a2a2761c | [
"Apache-2.0"
] | 32 | 2020-10-17T09:58:41.000Z | 2021-10-13T04:43:35.000Z | ML_AI/PyTorch/Enet_PyTorch.py | KeerthanaPravallika/OpenOctober | e93c120c90ce6c298b7052a2f7759560a2a2761c | [
"Apache-2.0"
] | 380 | 2020-10-18T15:35:49.000Z | 2021-12-25T05:03:50.000Z | ML_AI/PyTorch/Enet_PyTorch.py | KeerthanaPravallika/OpenOctober | e93c120c90ce6c298b7052a2f7759560a2a2761c | [
"Apache-2.0"
] | 68 | 2020-10-17T17:29:54.000Z | 2021-10-13T04:43:35.000Z | import torch.nn as nn
import torch
class InitialBlock(nn.Module):
"""The initial block is composed of two branches:
1. a main branch which performs a regular convolution with stride 2;
2. an extension branch which performs max-pooling.
Doing both operations in parallel and concatenating their results... | 36.307448 | 83 | 0.604889 |
39daf4ff16e74cc6352422464704f6ace218c2f7 | 188 | py | Python | mt/opencv/__init__.py | inteplus/opencvmt | 29a049f23f6bff8c3399cbadc527c9a6583737ec | [
"MIT"
] | null | null | null | mt/opencv/__init__.py | inteplus/opencvmt | 29a049f23f6bff8c3399cbadc527c9a6583737ec | [
"MIT"
] | null | null | null | mt/opencv/__init__.py | inteplus/opencvmt | 29a049f23f6bff8c3399cbadc527c9a6583737ec | [
"MIT"
] | null | null | null | from mt.base import logger
try:
import cv2
except ImportError:
logger.error("IMPORT: OpenCV for Python is not detected. Please install a version of OpenCV for Python.")
raise
| 23.5 | 109 | 0.739362 |
e268b6fe54ce941f8fa8ffdaf76596ff4424b290 | 1,695 | py | Python | migrations/versions/abcaeda711f9_.py | sroy8091/flask-app | e606574aa067edd77ebb3208af7bb9e57f2604fb | [
"MIT"
] | null | null | null | migrations/versions/abcaeda711f9_.py | sroy8091/flask-app | e606574aa067edd77ebb3208af7bb9e57f2604fb | [
"MIT"
] | null | null | null | migrations/versions/abcaeda711f9_.py | sroy8091/flask-app | e606574aa067edd77ebb3208af7bb9e57f2604fb | [
"MIT"
] | null | null | null | """empty message
Revision ID: abcaeda711f9
Revises: b1fc06bece22
Create Date: 2022-01-17 15:48:03.404712
"""
# revision identifiers, used by Alembic.
import json
import requests
from elasticsearch import helpers
from sqlalchemy import MetaData, Table
import config
from models import ES
revision = 'abcaeda711f9'
d... | 28.728814 | 299 | 0.615929 |
06127dc43d526f62659f60bc62eb04cdbe3aeb89 | 102 | py | Python | iunctus/cli/new.py | jeertmans/iunctus | b94ed9b36cb819d383e9946c45bac150a3e8df12 | [
"MIT"
] | null | null | null | iunctus/cli/new.py | jeertmans/iunctus | b94ed9b36cb819d383e9946c45bac150a3e8df12 | [
"MIT"
] | null | null | null | iunctus/cli/new.py | jeertmans/iunctus | b94ed9b36cb819d383e9946c45bac150a3e8df12 | [
"MIT"
] | null | null | null | import click
@click.command()
def new():
"""
Create a new iunctus project.
"""
pass
| 10.2 | 33 | 0.558824 |
724e3b904fb19209033887fec1e647694b3c716f | 6,394 | py | Python | src/oci/network_load_balancer/models/update_backend_set_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/network_load_balancer/models/update_backend_set_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/network_load_balancer/models/update_backend_set_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 36.329545 | 245 | 0.686894 |
d4353dbda697bf8e34fdd32d9a7a9506155e0bba | 580 | py | Python | deque.py | Nikhilxavier/Queue | ddb1a0be124d84b91a3872b09f1edc25af59aabf | [
"BSD-3-Clause"
] | null | null | null | deque.py | Nikhilxavier/Queue | ddb1a0be124d84b91a3872b09f1edc25af59aabf | [
"BSD-3-Clause"
] | null | null | null | deque.py | Nikhilxavier/Queue | ddb1a0be124d84b91a3872b09f1edc25af59aabf | [
"BSD-3-Clause"
] | null | null | null | """
Implementation of a Deque.
"""
# Author: Nikhil Xavier <nikhilxavier@yahoo.com>
# License: BSD 3 clause
class Deque:
"""Deque class with inbuilt functions."""
def __init__(self):
self.items = []
def add_front(self, item):
self.items.insert(0, item)
def add_rear(self, item):
... | 18.125 | 48 | 0.606897 |
8e21e8cf6b3f24ccae275e3c01232e19409d9c71 | 391 | py | Python | app/testAPI/wsgi.py | thenils/testing-pipeline-api | 2743c828cd988df04736c8c8da4a88ec3a389ebe | [
"MIT"
] | null | null | null | app/testAPI/wsgi.py | thenils/testing-pipeline-api | 2743c828cd988df04736c8c8da4a88ec3a389ebe | [
"MIT"
] | null | null | null | app/testAPI/wsgi.py | thenils/testing-pipeline-api | 2743c828cd988df04736c8c8da4a88ec3a389ebe | [
"MIT"
] | null | null | null | """
WSGI config for testAPI project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
4bc480c63e848d7f1aae5035b34f70fd00c0af08 | 296 | py | Python | mangopaysdk/types/bankaccountdetailsiban.py | bearstech/mangopay2-python-sdk | c01ff0bd55c0b2d6e53a81097d028fb1fa28fb1e | [
"MIT"
] | null | null | null | mangopaysdk/types/bankaccountdetailsiban.py | bearstech/mangopay2-python-sdk | c01ff0bd55c0b2d6e53a81097d028fb1fa28fb1e | [
"MIT"
] | null | null | null | mangopaysdk/types/bankaccountdetailsiban.py | bearstech/mangopay2-python-sdk | c01ff0bd55c0b2d6e53a81097d028fb1fa28fb1e | [
"MIT"
] | 1 | 2017-09-22T13:29:53.000Z | 2017-09-22T13:29:53.000Z | from mangopaysdk.types.bankaccountdetails import BankAccountDetails
class BankAccountDetailsIBAN(BankAccountDetails):
"""IBAN bank account type for BankAccount entity."""
def __init__(self):
self.IBAN = None
"""IBAN number"""
self.BIC = None
"""BIC"""
| 22.769231 | 67 | 0.665541 |
f9305966bc2d56abefd1c24ba4a808f79733ca6b | 706 | py | Python | drivers/sensor/ucube.py | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 6 | 2019-06-24T08:30:42.000Z | 2021-12-26T21:15:27.000Z | drivers/sensor/ucube.py | ewfweftwer/AliOS-Things | 26a5c1a2d6b1771590f5d302f0b2e7fe2fcf843e | [
"Apache-2.0"
] | 1 | 2019-04-02T10:03:10.000Z | 2019-04-02T10:03:10.000Z | drivers/sensor/ucube.py | ewfweftwer/AliOS-Things | 26a5c1a2d6b1771590f5d302f0b2e7fe2fcf843e | [
"Apache-2.0"
] | 9 | 2019-07-12T02:50:10.000Z | 2021-08-20T17:24:36.000Z | src =Split('''
hal/sensor_hal.c
hal/sensor_drv_api.c
drv/drv_temp_humi_baro_bosch_bme280.c
drv/drv_acc_bosch_bma253.c
drv/drv_baro_bosch_bmp280.c
drv/drv_acc_gyro_st_lsm6dsl.c
drv/drv_baro_st_lps22hb.c
drv/drv_acc_mir3_da217.c
drv/drv_als_ps_liteon_ltr553.c
drv/drv_temp_humi_sen... | 21.393939 | 41 | 0.73796 |
4dfb4322464ef67dd2c746182fa0238e362696d4 | 20,683 | py | Python | src/sas/sascalc/dataloader/file_reader_base_class.py | llimeht/sasview | d0c10746a2397c5021ed8bbc842ba99243a9b0ac | [
"BSD-3-Clause"
] | null | null | null | src/sas/sascalc/dataloader/file_reader_base_class.py | llimeht/sasview | d0c10746a2397c5021ed8bbc842ba99243a9b0ac | [
"BSD-3-Clause"
] | null | null | null | src/sas/sascalc/dataloader/file_reader_base_class.py | llimeht/sasview | d0c10746a2397c5021ed8bbc842ba99243a9b0ac | [
"BSD-3-Clause"
] | null | null | null | """
This is the base file reader class most file readers should inherit from.
All generic functionality required for a file loader/reader is built into this
class
"""
import os
import sys
import math
import logging
from abc import abstractmethod
import numpy as np
from .loader_exceptions import NoKnownLoaderException... | 40.634578 | 86 | 0.530339 |
32e221569c667e42504c29a9915fa44ee773a516 | 10,585 | py | Python | elekto/controllers/elections.py | elekto-io/elekto | 1052397d207bce351e9becb28df1561e19c82108 | [
"Apache-2.0"
] | 17 | 2021-01-19T03:32:58.000Z | 2022-02-15T07:11:05.000Z | elekto/controllers/elections.py | elekto-io/elekto | 1052397d207bce351e9becb28df1561e19c82108 | [
"Apache-2.0"
] | 20 | 2021-01-07T00:16:40.000Z | 2022-03-30T04:29:12.000Z | elekto/controllers/elections.py | elekto-io/elekto | 1052397d207bce351e9becb28df1561e19c82108 | [
"Apache-2.0"
] | 7 | 2021-01-06T03:51:37.000Z | 2022-03-05T04:32:43.000Z | # Copyright 2020 The Elekto Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 36.626298 | 90 | 0.602078 |
8cb49b68eddee7310d5a630d8be10af305b5f683 | 4,294 | py | Python | scripts/.config/scripts/i3-wk-switch/i3-wk-switch.py | gmartinezramirez/.dotfiles | 2e23909256cac0689615d2c61050dc8430413303 | [
"Apache-2.0"
] | 1 | 2018-04-14T01:09:50.000Z | 2018-04-14T01:09:50.000Z | scripts/.config/scripts/i3-wk-switch/i3-wk-switch.py | gmartinezramirez/.dotfiles | 2e23909256cac0689615d2c61050dc8430413303 | [
"Apache-2.0"
] | null | null | null | scripts/.config/scripts/i3-wk-switch/i3-wk-switch.py | gmartinezramirez/.dotfiles | 2e23909256cac0689615d2c61050dc8430413303 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""Emulates xmonad's workspace switching behavior in i3"""
# pylint: disable=no-member
import logging
import sys
from pprint import pformat
import i3
import time
LOG = logging.getLogger()
def setup_logger(level):
"""Initializes logger with debug level"""
LOG.setLevel(logging.DEBUG)
... | 30.671429 | 88 | 0.670703 |
325cff8e52ae4421a4599a74a66f4ac2a6d9f153 | 332 | py | Python | app/__init__.py | florinior12/SmartPlayer | c88b891bc377ee5f1c3554ca9870b68bc0ff47cd | [
"MIT"
] | null | null | null | app/__init__.py | florinior12/SmartPlayer | c88b891bc377ee5f1c3554ca9870b68bc0ff47cd | [
"MIT"
] | null | null | null | app/__init__.py | florinior12/SmartPlayer | c88b891bc377ee5f1c3554ca9870b68bc0ff47cd | [
"MIT"
] | null | null | null | #Import Flask
from flask import Flask
#Import SQLAlchemy
from flask_sqlalchemy import SQLAlchemy
#Create the app object
app = Flask(__name__)
#Load configurations from config file
app.config.from_object('config')
#load database from our app
db = SQLAlchemy(app)
app.secret_key = app.config['SECRET_KEY']
from app impor... | 18.444444 | 41 | 0.792169 |
881488c23a2fb60c458178dac014dd725c716dd5 | 434 | py | Python | worker_templates/python_empty/src/python_empty.py | larshesel/mzbench | f8da05dd2dfc06a87bc3870095e360ee184de4e2 | [
"BSD-3-Clause"
] | 127 | 2017-11-28T22:38:16.000Z | 2022-02-24T11:17:03.000Z | worker_templates/python_empty/src/python_empty.py | velimir/mzbench | 753d2e26fea92e0010c7e23378e93cb4ce982f20 | [
"BSD-3-Clause"
] | 42 | 2017-11-27T16:56:44.000Z | 2021-08-13T08:37:14.000Z | worker_templates/python_empty/src/python_empty.py | velimir/mzbench | 753d2e26fea92e0010c7e23378e93cb4ce982f20 | [
"BSD-3-Clause"
] | 27 | 2017-11-23T14:54:51.000Z | 2021-11-22T19:03:41.000Z | import random
import mzbench
def initial_state():
pass
def metrics():
return [
[
('print', 'counter'),
('print_2', 'counter')
],
('dummy', 'histogram')
]
def my_print(msg):
mzbench.notify(('print', 'counter'), 1)
mzbench.notify(('print_2', 'counte... | 17.36 | 75 | 0.543779 |
1c2b5cb3fc61452aed2ffa3b1df033d244d6a253 | 2,232 | py | Python | WaveBlocksND/GradientLinearCombinationHAWP.py | raoulbq/WaveBlocksND | 225b5dd9b1af1998bd40b5f6467ee959292b6a83 | [
"BSD-3-Clause"
] | 3 | 2016-09-01T21:13:54.000Z | 2020-03-23T15:45:32.000Z | WaveBlocksND/GradientLinearCombinationHAWP.py | raoulbq/WaveBlocksND | 225b5dd9b1af1998bd40b5f6467ee959292b6a83 | [
"BSD-3-Clause"
] | null | null | null | WaveBlocksND/GradientLinearCombinationHAWP.py | raoulbq/WaveBlocksND | 225b5dd9b1af1998bd40b5f6467ee959292b6a83 | [
"BSD-3-Clause"
] | 6 | 2016-03-16T15:22:01.000Z | 2021-03-13T14:06:54.000Z | """The WaveBlocks Project
Compute the action of the gradient operator applied to a
linear combination of Hagedorn wavepackets.
@author: R. Bourquin
@copyright: Copyright (C) 2013, 2014 R. Bourquin
@license: Modified BSD License
"""
from numpy import squeeze
from WaveBlocksND.Gradient import Gradient
from WaveBlocks... | 34.875 | 89 | 0.672939 |
ce71e754c607a9d1a5b16ca68246ec6b1e629154 | 11,876 | py | Python | src/RNAsketch-1.5/build/scripts-3.7/design-energyshift.py | lrsoenksen/CL_RNA_SynthBio | 08b67ac5b0b262c4a79217dfe1d7457cd42791ab | [
"MIT"
] | 5 | 2020-10-14T11:34:17.000Z | 2021-11-14T16:26:18.000Z | src/RNAsketch-1.5/build/scripts-3.7/design-energyshift.py | lrsoenksen/CL_RNA_SynthBio | 08b67ac5b0b262c4a79217dfe1d7457cd42791ab | [
"MIT"
] | null | null | null | src/RNAsketch-1.5/build/scripts-3.7/design-energyshift.py | lrsoenksen/CL_RNA_SynthBio | 08b67ac5b0b262c4a79217dfe1d7457cd42791ab | [
"MIT"
] | 2 | 2020-12-27T05:26:05.000Z | 2022-02-14T03:09:30.000Z | #!/anaconda3/bin/python
from __future__ import print_function
try:
from RNAsketch import *
except ImportError as e:
print(e)
exit(1)
import RNAblueprint as rbp
import argparse
import sys
import os
import time
from collections import Counter
from scipy import stats
def main():
parser = argparse.Argume... | 43.501832 | 190 | 0.60997 |
1f20f4d06db3ddc8eedf758807068421dff2ebb2 | 27,533 | py | Python | grr/server/grr_response_server/gui/api_plugins/client.py | JiYonG-Lee/grr | 57fef67080ac6b8fd3de3ba0adfca064d34b7689 | [
"Apache-2.0"
] | 1 | 2020-06-25T14:25:51.000Z | 2020-06-25T14:25:51.000Z | grr/server/grr_response_server/gui/api_plugins/client.py | JiYonG-Lee/grr | 57fef67080ac6b8fd3de3ba0adfca064d34b7689 | [
"Apache-2.0"
] | 3 | 2021-05-11T20:18:38.000Z | 2022-03-02T09:33:56.000Z | grr/server/grr_response_server/gui/api_plugins/client.py | JiYonG-Lee/grr | 57fef67080ac6b8fd3de3ba0adfca064d34b7689 | [
"Apache-2.0"
] | 1 | 2020-06-25T14:25:54.000Z | 2020-06-25T14:25:54.000Z | #!/usr/bin/env python
# Lint as: python3
"""API handlers for accessing and searching clients and managing labels."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import ipaddress
import re
from urllib import parse as urlparse
from grr_response_core.li... | 32.202339 | 80 | 0.743835 |
7438d0cf411d6ecea8a20bfbb737b01ed5398f7b | 11,286 | py | Python | microbenthos/utils/loader.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 3 | 2018-04-23T13:51:36.000Z | 2021-08-05T01:53:51.000Z | microbenthos/utils/loader.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 5 | 2018-04-09T20:08:40.000Z | 2018-05-04T23:08:50.000Z | microbenthos/utils/loader.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 2 | 2018-04-09T20:11:50.000Z | 2021-08-06T03:34:06.000Z | import logging
from collections.abc import Mapping
import cerberus
import pkg_resources
from fipy import PhysicalField
from sympy import Symbol, SympifyError, sympify
from .yaml_setup import yaml
# TODO: Allow equation with no diffusion term
physical_unit_type = cerberus.TypeDefinition('physical_unit', (PhysicalFiel... | 32.618497 | 98 | 0.584707 |
8b5eae90bfc6ed839b7200cffb3c1eb3d075f8c6 | 9,329 | py | Python | openaddr/util/__init__.py | andrewharvey/batch-machine | a5f6463ff7929b84c1131a3449e4796c3cdc692d | [
"0BSD"
] | 1 | 2021-09-02T04:13:10.000Z | 2021-09-02T04:13:10.000Z | openaddr/util/__init__.py | andrewharvey/batch-machine | a5f6463ff7929b84c1131a3449e4796c3cdc692d | [
"0BSD"
] | 12 | 2020-10-05T17:22:34.000Z | 2022-03-28T14:04:17.000Z | openaddr/util/__init__.py | andrewharvey/batch-machine | a5f6463ff7929b84c1131a3449e4796c3cdc692d | [
"0BSD"
] | 1 | 2021-04-19T10:53:10.000Z | 2021-04-19T10:53:10.000Z | import logging; _L = logging.getLogger('openaddr.util')
from urllib.parse import urlparse, parse_qsl, urljoin
from datetime import datetime, timedelta, date
from os.path import join, basename, splitext, dirname, exists
from operator import attrgetter
from tempfile import mkstemp
from os import close, getpid
import glo... | 34.047445 | 136 | 0.632222 |
06ff0fd7dfa4b9a68815f50e9a9a7f9b9b6ba2cc | 3,053 | py | Python | examples/wap/wap_data.py | ML-KULeuven/deepstochlog | 4b71d1e306d9cdbbb6237947533f0facfcc62c3a | [
"Apache-2.0"
] | 10 | 2021-12-06T02:07:19.000Z | 2022-03-24T11:40:10.000Z | examples/wap/wap_data.py | ML-KULeuven/deepstochlog | 4b71d1e306d9cdbbb6237947533f0facfcc62c3a | [
"Apache-2.0"
] | null | null | null | examples/wap/wap_data.py | ML-KULeuven/deepstochlog | 4b71d1e306d9cdbbb6237947533f0facfcc62c3a | [
"Apache-2.0"
] | null | null | null | import json
from collections.abc import Sequence
from pathlib import Path
from typing import Union
import typing
from deepstochlog.dataset import ContextualizedTermDataset
from deepstochlog.context import ContextualizedTerm, Context
from deepstochlog.term import Term, List
data_root = Path(__file__).parent / ".." / ... | 30.227723 | 77 | 0.59548 |
bc72d2abd90f4f8885a80918629b2c164bb4eeb7 | 8,612 | py | Python | backend/substrapp/tests/common.py | ClementGautier/substra-backend | e096e7c5abedc6847307353ffc3e6db28b047032 | [
"Apache-2.0"
] | null | null | null | backend/substrapp/tests/common.py | ClementGautier/substra-backend | e096e7c5abedc6847307353ffc3e6db28b047032 | [
"Apache-2.0"
] | null | null | null | backend/substrapp/tests/common.py | ClementGautier/substra-backend | e096e7c5abedc6847307353ffc3e6db28b047032 | [
"Apache-2.0"
] | null | null | null | from http.cookies import SimpleCookie
from io import StringIO, BytesIO
import os
import base64
from django.contrib.auth.models import User
from django.core.files.uploadedfile import InMemoryUploadedFile
from rest_framework.test import APIClient
# This function helper generate a basic authentication header with give... | 28.996633 | 119 | 0.680678 |
6aea88bccd2584e816f47d67938d512900944ae1 | 2,232 | py | Python | cs28TeamProject/parasitologyTool/migrations/0043_auto_20220219_1321.py | Eg3-git/cs28-parasitology-tool | 4389208ed19f7e348ca931bff48d43263451f7f0 | [
"CC0-1.0"
] | null | null | null | cs28TeamProject/parasitologyTool/migrations/0043_auto_20220219_1321.py | Eg3-git/cs28-parasitology-tool | 4389208ed19f7e348ca931bff48d43263451f7f0 | [
"CC0-1.0"
] | null | null | null | cs28TeamProject/parasitologyTool/migrations/0043_auto_20220219_1321.py | Eg3-git/cs28-parasitology-tool | 4389208ed19f7e348ca931bff48d43263451f7f0 | [
"CC0-1.0"
] | null | null | null | # Generated by Django 3.2.9 on 2022-02-19 13:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('parasitologyTool', '0042_researchpost_likes'),
]
operations = [
migrations.AlterField(
model_name='article',
name='i... | 37.830508 | 178 | 0.600806 |
cac64d407a97fb8de2d1203aafef19c9e7930ffa | 351 | py | Python | lesson_3.6.2.py | aafedotov/stepik_oop | 177370a2e809090f66b3c71c594c0582754fddc6 | [
"MIT"
] | null | null | null | lesson_3.6.2.py | aafedotov/stepik_oop | 177370a2e809090f66b3c71c594c0582754fddc6 | [
"MIT"
] | null | null | null | lesson_3.6.2.py | aafedotov/stepik_oop | 177370a2e809090f66b3c71c594c0582754fddc6 | [
"MIT"
] | null | null | null | class Quadrilateral:
def __init__(self, *args):
self.width = args[0]
self.height = args[-1]
def __bool__(self):
return self.width == self.height
def __str__(self):
if self:
return f'Куб размером {self.width}х{self.height}'
return f'Прямоугольник размер... | 23.4 | 67 | 0.603989 |
0f4d533331d7426285a5f9944d6d2ade372ff749 | 391 | py | Python | crudcbv/asgi.py | CleitonCandiotto/Criando-CRUD-Django | 2ca749546be64af0a105d1337a4393d69454e00a | [
"MIT"
] | null | null | null | crudcbv/asgi.py | CleitonCandiotto/Criando-CRUD-Django | 2ca749546be64af0a105d1337a4393d69454e00a | [
"MIT"
] | null | null | null | crudcbv/asgi.py | CleitonCandiotto/Criando-CRUD-Django | 2ca749546be64af0a105d1337a4393d69454e00a | [
"MIT"
] | null | null | null | """
ASGI config for crudcbv project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
7a73d86793f87b7421eeb500b431f1a5ced3460d | 11,865 | py | Python | intersight/model/storage_physical_disk_extension_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/storage_physical_disk_extension_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/storage_physical_disk_extension_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 53.687783 | 1,678 | 0.650737 |
dbfc4edbeb59287ed066904195c4d8cbb97d0f99 | 463 | py | Python | Input-Output/files and file writing.py | rlwheelwright/PY3_StandardLib | 0d9acc02f5ca934eab774bbdd5acc3c92eff7191 | [
"Apache-2.0"
] | null | null | null | Input-Output/files and file writing.py | rlwheelwright/PY3_StandardLib | 0d9acc02f5ca934eab774bbdd5acc3c92eff7191 | [
"Apache-2.0"
] | null | null | null | Input-Output/files and file writing.py | rlwheelwright/PY3_StandardLib | 0d9acc02f5ca934eab774bbdd5acc3c92eff7191 | [
"Apache-2.0"
] | null | null | null | # Files and File Writing
# Open a file
myFile = open("score.txt", "w")
# w ==> write
# r ==> read
# r+ ==> read and write
# a ==> append
# Show attributes and properties of that file
print("Name" + myFile.name)
print("Mode " + myFile.mode)
# Write to a file
myFile.write("GBJ: 100\nKHD: 99\nBBB: 89")
myFile.close()
... | 19.291667 | 45 | 0.645788 |
165e67386ae7add637e949082222ccbf49e1ba7e | 28,510 | py | Python | test/functional/wallet_bumpfee.py | Cminor-pools/bitcoinvg | d47a3cf13e06f4fe03d965826f5309e6d5706470 | [
"MIT"
] | null | null | null | test/functional/wallet_bumpfee.py | Cminor-pools/bitcoinvg | d47a3cf13e06f4fe03d965826f5309e6d5706470 | [
"MIT"
] | null | null | null | test/functional/wallet_bumpfee.py | Cminor-pools/bitcoinvg | d47a3cf13e06f4fe03d965826f5309e6d5706470 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | 48.158784 | 175 | 0.714626 |
4cbb594016d6ab1241259e66e8d9cf6b3cb87aae | 7,398 | py | Python | napari/layers/transforms.py | danielballan/napari | 9963d6bf52971f8f240b507be206ec682487fb4a | [
"BSD-3-Clause"
] | null | null | null | napari/layers/transforms.py | danielballan/napari | 9963d6bf52971f8f240b507be206ec682487fb4a | [
"BSD-3-Clause"
] | null | null | null | napari/layers/transforms.py | danielballan/napari | 9963d6bf52971f8f240b507be206ec682487fb4a | [
"BSD-3-Clause"
] | null | null | null | import toolz as tz
from typing import Sequence
import numpy as np
from ..utils.list import ListModel
class Transform:
"""Base transform class.
Defaults to the identity transform.
Parameters
----------
func : callable, Coords -> Coords
A function converting an NxD array of coordinates to ... | 32.88 | 80 | 0.603406 |
de9b5825fbf0a593209dc2e85ad58051c95e0f40 | 22,200 | py | Python | tests/unit/backend/wmg/test_query.py | chanzuckerberg/dcp-prototype | 24d2323ba5ae1482395da35ea11c42708e3a52ce | [
"MIT"
] | null | null | null | tests/unit/backend/wmg/test_query.py | chanzuckerberg/dcp-prototype | 24d2323ba5ae1482395da35ea11c42708e3a52ce | [
"MIT"
] | 105 | 2020-01-23T22:08:48.000Z | 2020-05-07T00:04:20.000Z | tests/unit/backend/wmg/test_query.py | chanzuckerberg/dcp-prototype | 24d2323ba5ae1482395da35ea11c42708e3a52ce | [
"MIT"
] | 1 | 2020-03-20T17:06:54.000Z | 2020-03-20T17:06:54.000Z | import unittest
from typing import NamedTuple
from backend.wmg.api.v1 import build_dot_plot_matrix
from backend.wmg.data.query import WmgQueryCriteria, WmgQuery
from backend.wmg.data.schemas.cube_schema import cube_non_indexed_dims
from tests.unit.backend.wmg.fixtures.test_snapshot import (
create_temp_wmg_snapsho... | 42.205323 | 120 | 0.578514 |
b570aac2c75f5ef17950506f72322fbcf40d633f | 1,836 | py | Python | src/brushlib/generate.py | stippi/WonderBrush-v3 | 7f88c3e4fbe0bca9ef2df7a92d44789877edfe1e | [
"MIT"
] | 30 | 2018-11-01T18:31:04.000Z | 2021-12-27T17:00:59.000Z | src/brushlib/generate.py | pulkomandy/WonderBrush-v3 | 7878ff8ee627de5f47519d7b55a710a544f36f12 | [
"MIT"
] | 5 | 2018-11-01T20:01:41.000Z | 2021-12-06T11:15:12.000Z | src/brushlib/generate.py | pulkomandy/WonderBrush-v3 | 7878ff8ee627de5f47519d7b55a710a544f36f12 | [
"MIT"
] | 1 | 2020-05-04T10:33:13.000Z | 2020-05-04T10:33:13.000Z | #!/usr/bin/env python
# brushlib - The MyPaint Brush Library
# Copyright (C) 2007-2008 Martin Renold <martinxyz@gmx.ch>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appe... | 39.913043 | 76 | 0.715142 |
37daf25d7714d98e2b1a512eda786170b5638c7a | 24,870 | py | Python | pyKneeSPM/knee_spm.py | gattia/pyKneeSPM | aff17c92119382a1c7ebb124a6e13b12c41967a8 | [
"MIT"
] | 1 | 2021-05-18T22:13:01.000Z | 2021-05-18T22:13:01.000Z | pyKneeSPM/knee_spm.py | gattia/pyKneeSPM | aff17c92119382a1c7ebb124a6e13b12c41967a8 | [
"MIT"
] | 1 | 2022-03-28T16:25:06.000Z | 2022-03-28T16:25:06.000Z | pyKneeSPM/knee_spm.py | gattia/pyKneeSPM | aff17c92119382a1c7ebb124a6e13b12c41967a8 | [
"MIT"
] | 1 | 2021-05-18T22:13:02.000Z | 2021-05-18T22:13:02.000Z | import numpy as np
from vtk.util.numpy_support import numpy_to_vtk, vtk_to_numpy
from .vtk_functions import (read_vtk,
apply_transform,
get_icp_transform,
transfer_mesh_scalars_get_weighted_average_n_closest)
from . import test_statistics
... | 49.640719 | 144 | 0.563691 |
877563710956abe77683fa9ab3678401c98bb799 | 1,378 | py | Python | nipy/labs/glm/tests/test_glm.py | bpinsard/nipy | d49e8292adad6619e3dac710752131b567efe90e | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | nipy/labs/glm/tests/test_glm.py | bpinsard/nipy | d49e8292adad6619e3dac710752131b567efe90e | [
"BSD-3-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | nipy/labs/glm/tests/test_glm.py | bpinsard/nipy | d49e8292adad6619e3dac710752131b567efe90e | [
"BSD-3-Clause"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | #!/usr/bin/env python
from __future__ import absolute_import
import numpy as np
from ..glm import glm
from numpy.testing import assert_almost_equal, TestCase
class TestFitting(TestCase):
def make_data(self):
dimt = 100
dimx = 10
dimy = 11
dimz = 12
self.y = np.random.ra... | 24.607143 | 74 | 0.560958 |
fa0fbd04fca9b545dff827b7cdaa5faf246a611c | 412 | py | Python | String/python/leetcode434_Number_of_Segments_in_a_String.py | wenxinjie/leetcode | c459a01040c8fe0783e15a16b8d7cca4baf4612a | [
"Apache-2.0"
] | null | null | null | String/python/leetcode434_Number_of_Segments_in_a_String.py | wenxinjie/leetcode | c459a01040c8fe0783e15a16b8d7cca4baf4612a | [
"Apache-2.0"
] | null | null | null | String/python/leetcode434_Number_of_Segments_in_a_String.py | wenxinjie/leetcode | c459a01040c8fe0783e15a16b8d7cca4baf4612a | [
"Apache-2.0"
] | null | null | null | # Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.
# Please note that the string does not contain any non-printable characters.
# Example:
# Input: "Hello, my name is John"
# Output: 5
class Solution(object):
def countSegments(self, s):
... | 25.75 | 123 | 0.648058 |
e979c996b291d12d107dc787e950b991b416e02a | 3,094 | py | Python | kheops_client/_utils.py | hirsch-lab/kheops-client | ce40f2aa94eb12e47b3cd5417a6cc5f915c39eb1 | [
"MIT"
] | 1 | 2021-03-19T10:28:15.000Z | 2021-03-19T10:28:15.000Z | kheops_client/_utils.py | hirsch-lab/kheops-client | ce40f2aa94eb12e47b3cd5417a6cc5f915c39eb1 | [
"MIT"
] | null | null | null | kheops_client/_utils.py | hirsch-lab/kheops-client | ce40f2aa94eb12e47b3cd5417a6cc5f915c39eb1 | [
"MIT"
] | null | null | null | import time
import pandas as pd
import pydicom as dicom
from pathlib import Path
def ensure_dir(path, forced):
path = Path(path)
if not path.is_dir():
path.mkdir(parents=True, exist_ok=forced)
return path.is_dir()
def flatten(value):
return value[0] if value is not None and len(value)==1 else... | 25.783333 | 74 | 0.600194 |
1571ae5ae92387dd2627dd76c40db6ffa8e704ed | 35,058 | py | Python | chalicelib/aws_data_api.py | awslabs/aws-data-api | 81f6ad1fd89935fcec600ced2b404f37d87254fe | [
"Apache-2.0"
] | 90 | 2020-11-20T12:35:03.000Z | 2021-07-29T21:20:55.000Z | chalicelib/aws_data_api.py | awslabs/aws-data-api | 81f6ad1fd89935fcec600ced2b404f37d87254fe | [
"Apache-2.0"
] | 1 | 2020-11-20T13:11:09.000Z | 2020-11-20T13:11:09.000Z | chalicelib/aws_data_api.py | awslabs/aws-data-api | 81f6ad1fd89935fcec600ced2b404f37d87254fe | [
"Apache-2.0"
] | 6 | 2020-11-23T11:09:04.000Z | 2022-03-16T14:40:52.000Z | from chalicelib.exceptions import *
import chalicelib.utils as utils
import chalicelib.parameters as params
from chalicelib.utils import identity_trace
import logging
from chalicelib.api_metadata import ApiMetadata
from chalicelib.gremlin_handler import GremlinHandler
import sys
import os
import urllib.parse as parser
... | 44.265152 | 171 | 0.62602 |
ba036309723816995f4173198b26bd2ff14b39a0 | 1,779 | py | Python | Torch/kerman_circuits.py | Shahrukh-Chishti/DiSuQ | 2306da37b77685f06c598f59484b73cba500d94e | [
"Apache-2.0"
] | null | null | null | Torch/kerman_circuits.py | Shahrukh-Chishti/DiSuQ | 2306da37b77685f06c598f59484b73cba500d94e | [
"Apache-2.0"
] | null | null | null | Torch/kerman_circuits.py | Shahrukh-Chishti/DiSuQ | 2306da37b77685f06c598f59484b73cba500d94e | [
"Apache-2.0"
] | null | null | null | import numpy,sys
from circuit import Circuit, hamiltonianEnergy, phase
from components import J,C,L,pi,h
from numpy.linalg import det
from pyvis import network as pvnet
def transmon(basis,Ej=10,Ec=0.3):
transmon = [J(0,1,Ej)]
transmon += [C(0,1,Ec)]
transmon = Circuit(transmon,basis)
return transmon
... | 30.672414 | 101 | 0.613266 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.