blob_id
stringlengths
40
40
content_id
stringlengths
40
40
repo_name
stringlengths
5
114
path
stringlengths
5
318
language
stringclasses
5 values
extension
stringclasses
12 values
length_bytes
int64
200
200k
license_type
stringclasses
2 values
content
stringlengths
143
200k
4161cc9b66badae7421a0f1401ad4898cc889218
15d75f6f8f7d04950db43ab5dc30ee8c221101bc
XHermitOne/iq_framework
/iq/components/data_query/view_sql_query_dlg_proto.py
Python
py
7,043
no_license
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Oct 26 2018) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! ########################################################################### impor...
4d1892c7b852826c9447f101647d961d989b16ad
d5ab7d0e931b9e8287402cfa64976099868f4c31
autherm/jeopardy_parser_copy
/parser.py
Python
py
5,663
permissive
#!/usr/bin/env python -OO # -*- coding: utf-8 -*- from __future__ import with_statement from glob import glob import argparse, re, os, sys, sqlite3 from bs4 import BeautifulSoup def main(args): """Loop thru all the games and parse them.""" if not os.path.isdir(args.dir): print "The specified folder is not a dire...
3edc19fe68da90192e7ada2c64d8600de1791d66
ce69989889313ce235e85eb3ee853edd9d9f3beb
0xcyberpj/FwordCtf2021-Reverse-Challenges-Source
/Omen Source Code/Assembly_Creator.py
Python
py
1,191
no_license
from random import randrange def xor(x,y): return x^y def add(x,y): return (x+y)%256 def sub(x,y): return (x-y)%256 def and_(x,y): return x&y def or_(x,y): return x|y instr=["xor","add","sub","and","or","xor","xor"] funcs=[xor,add,sub,and_,or_,xor,xor] flag="FWORDctf{Wh4...
54e59d3746d82f3591344c18618e736923f1a8d1
9deefc59ff6e6634ea44a52bd6ad3f4370bddb68
vishankkumar/pymatgen
/pymatgen/cli/pmg_config.py
Python
py
6,633
permissive
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Implementation for `pmg config` CLI. """ import glob import os import shutil import subprocess import sys from urllib.request import urlretrieve from monty.serialization import dump...
64c65b431e19853023629d702fa24356f7ee8af2
a81104587bb41a11af1f04b034c010278522fd98
Ryan-A-Armstrong/mvn-analysis
/mvnTools/MeshTools2d.py
Python
py
1,948
no_license
import numpy as np from numba import njit, prange @njit(parallel=True) def smooth_dtransform_auto(img_dist, img_skel, verbose=True): if verbose: print('\t - Transforming euclidean distance to radial distance') print('\t\t - Automating kernel size along skeleton path') dim = list(img_dist.shape...
7eddace1ec81263e5d810e60a0d0cf9c085d1cfd
413fdaa21095ee5061cbddbdd09ce1d27885f62e
hashdd/pyhashdd
/hashdd/algorithms/hashdd_content_hash.py
Python
py
4,078
permissive
""" @brad_anton License: Copyright 2015 hashdd.com 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 ...
170cd87d7eb0d3458aee1f544a361add615a28e3
de104db853965374bb956b4e7cb9daec9b3d447a
django/daphne
/daphne/apps.py
Python
py
476
permissive
# Import the server here to ensure the reactor is installed very early on in case other # packages import twisted.internet.reactor (e.g. raven does this). from django.apps import AppConfig from django.core import checks import daphne.server # noqa: F401 from .checks import check_daphne_installed class DaphneConfig...
d4303bafc6a177294fa4cc0bf02344a03f1c87ed
91986640184e5c9f7f3e0645c90b7e5e7e51cd76
Stevenholloway/SHARE
/providers/org/biorxiv/harvester.py
Python
py
3,118
permissive
import logging import re from furl import furl from bs4 import BeautifulSoup from share import Harvester logger = logging.getLogger(__name__) class BiorxivHarvester(Harvester): url = 'http://biorxiv.org/search/' def do_harvest(self, start_date, end_date): end_date = end_date.date() start_...
bf78820a4e1442bb97096c303e79e59e953fc317
3fd732b895c3660ec61c626c4caf8986806da525
doduythao/BarcodeProject
/model/model.py
Python
py
5,805
no_license
import glob import os import torch import torch.nn as nn class Model(nn.Module): CHECKPOINT_FILENAME_PATTERN = 'model-{}.pth' __constants__ = ['_hidden1', '_hidden2', '_hidden3', '_hidden4', '_hidden5', '_hidden6', '_hidden7', '_hidden8', '_hidden9', '_hidden10', '_...
6ec24e7041125299f96ddbcb612240b25c477b60
c9345669819d77cd64c6a41e3ef83c95740d1ad3
anoken/maix_maniax
/05_maixduino_esp32/03_maixpy_network_udp_client.py
Python
py
1,034
no_license
## Copyright (c) 2019 aNoken import network, usocket from Maix import GPIO from fpioa_manager import fm, board_info WIFI_SSID = "your_ssid" WIFI_PASSWD = "your_passwd" server_ip = "192.168.10.2" server_port = 8080 # IO map for ESP32 on Maixduino fm.register(25,fm.fpioa.GPIOHS10)#cs fm.register(8,fm.fpioa.GP...
528b2b76a003da71aaed7d0d9a73286b759a5d81
bcdb0ab518136e99b5e47b906d14526693e85065
olivares10/proyectoPython
/tarea/ejercicio2.py
Python
py
2,564
no_license
# Ctrl+K y Ctrl+C o Ctrl+U # ejercicio2 # i = int(input("Ingrese Numero de inicio:")) # j = int(input("Ingrese Numero de fin:")) # contador = 0 # for numero in range(i,j+1): # contador = numero + contador # print(f"Resultado:{contador} ") # ejercicio3 # i = int(input("Ingrese Numero de inicio:")) # j = int...
8a134329e44e661dc0a64d4fae46aff817067646
0580541d5651997e461caf4e4b64a2fb25804e19
ahdahddl/cytoscape
/csplugins/trunk/ucsd/rsaito/rs_Progs/rs_Python/rs_Python_Pack/tags/rs_Python_Pack090515/SAT_Packages/ANALYSIS_SCR_SAT1/analysis_norm_cancer11k_AFAS4.py
Python
py
18,371
no_license
#!/usr/bin/env python """ This module integrates Multiple normal tissues (11K) and normal/cancer tissues (11K) and calculates all the necessary information. """ import math import sys from Calc_Packages.Math.Vector1 import vector_pair from Calc_Packages.Math.Stats_OrderI import median, ordering from Calc_Packages.Mat...
a829cd423e6e33ddc7377475d1cbc5f12449563b
f852c6c28a28a0357f1e2fd85c08c4322aab4966
pulumi/pulumi-gcp
/sdk/python/pulumi_gcp/ml/engine_model.py
Python
py
26,850
permissive
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
cd980a003c8ccd8bc5bc76edeb3d57778a6ce4c7
db76eb02e1c10b6c4e0addc5e2138c8bba0c518a
GISdeveloper2017/imetadata
/imetadata/business/metadata/base/plugins/industry/sat/base/base/c_radarSatPlugins.py
Python
py
1,720
no_license
# -*- coding: utf-8 -*- # @Time : 2020/9/19 18:24 # @Author : 王西亚 # @File : c_satPlugins.py from imetadata.base.c_file import CFile from imetadata.business.metadata.base.plugins.c_satPlugins import CSatPlugins class CRadarSatPlugins(CSatPlugins): """ 光学卫星数据插件 . 如果卫星数据是文件, 则先检查文件名是否在指定的列表中, 之后再检查文件主名是否匹...
963af13845de9589a5cd96501af7fcba4903c380
097da347d9b983c931668dc594bfff575d26e488
ashibaev/python
/Sort/tests.py
Python
py
8,322
no_license
import asyncio import os import tempfile import unittest from out_sort.sort_statistic import State from out_sort.sort_statistic import Statistic import out_sort.out_sort as out_sort from utils import file_generator class StatisticTest(unittest.TestCase): def test_next_state_raises_exception(self): ...
528005d474bea83dbbaf731cd892ce8b27edc077
ded7daa3afc37ff5e62619c9710794a9f714458f
kivmi/bfs_in_parallel
/transform.py
Python
py
1,723
no_license
#!/usr/bin # a script transforming the graph's format # the orginal format of the graph which is # generated by Stanford SNAP library is: # # edge pairs = (node id, node id) # # the onject format is: # node pairs = (edge_start, edge_width) # edge pairs = (dest_node, weight) import string filename = "test.txt" infil...
b8dc9937e14b40b2ee5f6419bcd9672f9b059fbe
e4b58215f66b51e34c3075c7ae135fdc33b73ea4
Neronjust2017/DL-TSC
/grid_search_hyperparamters.py
Python
py
4,695
permissive
from comet_ml import experiment from data_loader.uts_classification_data_loader import UtsClassificationDataLoader from models.uts_classification_model import UtsClassificationModel from trainers.uts_classification_trainer import UtsClassificationTrainer from evaluater.uts_classification_evaluater import UtsClassificat...
dfe18b7f5ec3f6ec0bc26360df4080ae011e59f0
3b1947b4733afd2c736c2d78883854edcfbc356e
Alvaro-P-R/Bot-
/Bot.py
Python
py
527
no_license
from selenium import webdriver from time import sleep from selenium.common.exceptions import ElementClickInterceptedException from selenium.webdriver.common.keys import Keys web = ("https://www.jesusninoc.com/powershell/page/2/") driver = webdriver.Chrome() driver.maximize_window() driver.get(web) a = 1 for i i...
ae9f2b1d0ee4115f43a9245c7f98ec019a3bb4da
c467b60cb43695d1e45a88c090e809ec8c7a2adc
trevormiller35/GuessTheNumber
/GuessTheNumber.py
Python
py
609
no_license
from random import randint def main(): case = 1 lossCount = 0 while case: num = randint(1,10) guess = int(input(print("Guess the number between 1 and 10"))) if guess > 0 & guess < 11: if guess == num: print("You win!") print("It...
55a7b22fbea0bc398ab4c57749bd6fd329e0fda3
94e135cf66dce30ae3cf319c2ac54e709504dcfe
edkami/edkami-igit_engdados_ap_mod1
/main.py
Python
py
1,046
no_license
import pandas as pd from create_banco_dados import create_db from insert_dados import inserir_dados # Importando o arquivo xlsx no pandas file = 'datasetTP.xlsx' xls_file = pd.ExcelFile(file) # Criando dicionários de dados para cada shape do excel dfs_editora = pd.read_excel(xls_file, 'editora') dfs_area_conhecimento...
0171003db35699583773aa7990f8e6d8ab6943e9
3e50dcf3e94d7c4b61f88442fd40784f630acd53
adamltyson/imlib
/imlib/general/exceptions.py
Python
py
529
permissive
class CommandLineInputError(Exception): """Exception raised for incorrect or illogical command line inputs that are not caught elsewhere. Attributes: expression -- input expression in which the error occurred message -- explanation of the error """ def __init__(self, message): ...
5e01ed96c7027c80c575598f271552b34dd6ae09
a2fdcc34e58476708c973d9e2163c56b0268d05e
Jzarecta/CryptoPerformance
/lib/cryptocurrencies.py
Python
py
321
no_license
# List of cryptocurrencies cryptocurrencies = [ 'bitcoin', 'litecoin', 'xrp', 'bitcoin-cash', 'eos', 'ethereum', 'binance-coin', 'tron', 'monero', 'bitcoin-sv', 'chainlink', 'cardano', 'stellar', 'dash', 'pivx' ]...
a1e8ec3065809e43d6a431b39c80be34a511c002
ffad360ee3ad6323b1af3c01e1500f1930657153
echang19/Homework-9-25
/OperationsPracticecontinued.py
Python
py
1,022
no_license
''' Created on Sep 27, 2018 @author: echang19 ''' print('welcome to the test score calculator.') print("\n\n\n\n") # input the test scores test1=float(input("Please enter the first test score: ")) test2=float(input("Please enter the second test score: ")) test3=float(input("Please enter the third test ...
4cba39bd8ad7f65724ebb22be4a66d36b94b8e79
fa701ab71d1c127687090215146bb130ddb9be28
mbmcavoy/adventofcode
/2019/2019-07/2019-07a.py
Python
py
12,654
no_license
def main(): # Test getParamMode input_file = open("2019/2019-07/input.txt") program_string = input_file.readline() program = [int(value) for value in program_string.split(",")] testResults = [] combinationCounter = 1 for place0 in range (5): for place1 in range (4): ...
6f24ce8fa60b2c87db8aff919f596760c2a1c37e
aac833ba1eef575bbc2ef0b9574485446e07ed0e
ardgek/projet_bts
/gestchauffage/views.py
Python
py
14,325
no_license
from flask import Flask, render_template, request, session, url_for, redirect, Response from gestchauffage.bdd_login import * from gestchauffage.temperature import * from datetime import datetime import json import time app = Flask(__name__) app.secret_key = b'_5#y2L"F4Q8z\n\xec]/' @app.route('/') def home(): if...
28f64cce03009cd60c1637e33b9593708d8f9b1c
d968a2e93ff3295cdea7873d7e6e2a7ab3c427e4
Archeane/SBL
/sparser.py
Python
py
6,694
no_license
from sly import Lexer from sly import Parser class BasicLexer(Lexer): tokens = { NAME, NUMBER, STRING, BOOLEAN, ANDALSO, NOT, PRINT, ARRAY, ASSIGN, EQ, BLOCK} ignore = '\t ' literals = { '=', '+', '-', '/', '*', '(', ')', ',', ';', '[', ']', '{', '}'} E...
e6dfa6910f04ce64f4bda6f0b6739d9355e22fbf
dc43a16476b9023d8b2b9f207d590298bf9520dd
FF120/python
/fmri_analysis/fmri/nilearn_learn/fmri2001-anova.py
Python
py
1,889
no_license
# -*- coding: utf-8 -*- from nilearn import datasets from nilearn.input_data import NiftiMasker from sklearn.svm import SVC from sklearn.feature_selection import SelectKBest, f_classif from sklearn.cross_validation import KFold from sklearn.cross_validation import cross_val_score from sklearn.cross_validation import Le...
e23af6fc9b5de0482a47391fea379783cf532559
e58ea14a38a07d5c59cb3559a6f36d92d0e8d2a9
bulentelmaci/azure-sdk-for-python
/azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/image_create_summary.py
Python
py
1,332
permissive
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
a017e5472ab33a3b58809dfd9c345e887ad21d7f
5001f923b52dfad4002215cbf8bd3238fd970a21
andydandy74/ClockworkForDynamo
/nodes/0.9.x/python/Element.ID.py
Python
py
392
permissive
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) items = UnwrapElement(IN[0]) elementlist = list() booleans = list() for item in items: try: elementlist.append(item.Id) booleans.append(True) except: element...
8c3626bb1d03bdb01c3e583fbf9e696161b1200a
351498766170b4c4b1c169fba6ec628aa4ef0766
fameshpatel/olfactorybulb
/prev_ob_models/exclude/GilraBhalla2015/simulations/odor_pulseinresp_repeats.py
Python
py
12,699
permissive
# -*- coding: utf-8 -*- # ALL SI UNITS # milliMolar is same as mol/m^3 ## USAGE: nohup python2.6 odor_pulseinresp_repeats.py &> nohup_pulseinresp.out < /dev/null & ## if running multiple of these, change pulseinresp to pulseinresp1, pulseinresp2, etc above, ## change loop lists to result in largely non-overlapping run...
b2217c78ab246a61ec0c9143c6b571139acc6c69
deb02b000ad3c64541e164fdd7d0cca39b81faf8
AKST/algos
/scripts/pretty_printer.py
Python
py
12,132
permissive
import plyj.parser as plyj class UnsupportedASTError(ValueError): pass class PrettyPretter: def __init__(self, indentation=4): self.out = None self.current_indent = None self.indentation_amount = indentation def print_tree(self, tree): self.out ...
d688bf536ff8f207b969a5404d89958a9cc18b1d
d63b118aea4ef719a08288ebdb75753560343b74
fsimkovic/pyjob
/pyjob/tests/test_local.py
Python
py
5,610
permissive
import os import sys import time import pytest from pyjob.exception import PyJobError, PyJobTaskLockedError from pyjob.local import CPU_COUNT, LocalTask @pytest.mark.skipif(pytest.on_windows, reason="Deadlock on Windows") class TestLocalTaskTermination(object): def test_terminate_1(self): scripts = [pyte...
3404ed9187d0f9e9bb949be9dc084f1cff431115
0a55c777408e885f88ef13c68cd27f435b1626e2
yaron1000/pshapes_site
/pshapes_site/settings.py
Python
py
4,418
no_license
""" Django settings for pshapes_site project. Generated by 'django-admin startproject' using Django 1.8.6. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build...
eea11cad3ad8bf10a4414e342670dabae2350ed5
b01d12ac8ebc396ff20b899b183437e44ff6bc4b
el-mat/ectools
/gccontent.py
Python
py
1,466
permissive
#!/usr/bin/env python import sys from seqio import fastaIterator def getGCSlidingWindow(sequence, window_size): '''Calculates %GC in sequence of sliding window window_size''' return map(lambda x: (x.count("G")+x.count("C")) / float(window_size), map(lambda r: sequence[r:r+window_size], ...
7566ce0190a15156b58aeac02640cb9ee8711dbf
3e74f5da65e6afbe81f8e8170607f28c1e0171ce
odin793/pytelegraf
/telegraf/utils.py
Python
py
1,506
permissive
def format_string(key): """Formats either measurement names, tag names or tag values. Measurement name and any optional tags separated by commas. Measurement names, tag keys, and tag values must escape any spaces, commas or equal signs using a backslash (\). For example: \ and \,. All tag values...
143b523d3e30c152c6e7e7af184eeb28fa0c2fe1
6e16d4b36d4f6f6ab8dac013014b4cdd7875a2cb
nipun510/learning
/python/operators.py
Python
py
674
no_license
class C: def __init__(self, val): self.data = val def __call__(self): print('object called') def __add__(self, other): return self.data + other def __radd__(self, other): return self.__add__(other) def __eq__(self, other): return self.data == other def __gt__(self, other): # 3.X and 2.X version r...
107b1012c3ca53e0df75c38397c830e3ede68641
f9dae48208e9c0b4217f0613425c30b3faa260ba
commial/temp
/api_miasm/winfax.dll.py
Python
py
20,304
no_license
###### Enums ###### ################### ###### Types ###### ################### ###### Functions ###### def winfax_FaxOpenPort(jitter): """ BOOL FaxOpenPort( HANDLE FaxHandle, DWORD DeviceId, DWORD Flags, LPHANDLE FaxPortHandle ) """ ret_ad, args = jitter.func_ar...
c21c2bb9ec61a9aac733d73e4d899173c37805d9
c71566734853852f364e4b172c31559dc5416402
maxmumford/sy_cm_postcode
/cm_postcode.py
Python
py
2,111
no_license
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # Copyright (C) 2013-today Synconics Technologies Pvt. Ltd. (<http://www.synconics.com>) # # Th...
590788082faf44746b6a02c871a892cf51a7df48
ed2b769f12a0b3c6acdc0383ec961e6020bf8cd4
AhmedElsagher/algorithm-toolbox
/week3_greedy_algorithms/5_collecting_signatures/covering_segments.py
Python
py
991
no_license
# Uses python3 import sys from collections import namedtuple Segment = namedtuple('Segment', 'start end') def optimal_points(starts,ends): points = [] zip_st_en=sorted(zip(starts,ends)) starts,ends=zip(*zip_st_en) #write your code here points.append(ends[0]) for i in range(len(starts)): ...
f59ab9b75bb7a684d7ef4510e6ae46eee77a3011
ee53ff6ec563f31b8f5a470091fe96b16a684489
lvhlucas/Monitoria_Web
/test/factories/user.py
Python
py
1,305
no_license
import factory import django.contrib.auth.models as auth_models from django.contrib.auth.models import Group from django.contrib.auth.hashers import make_password from subsistema.models import Materia, Curso, Aluno user_password = 'foo' class AlunoGroupFactory(factory.django.DjangoModelFactory): class Meta: ...
5426df0754f387271a027f1b697b66ccedc87835
41e01f462c77558ea34f03fe8d77b5247b604755
DebugChen/Web-UI
/CK_CLJK/LCTJFX/LCTJFX_Result.py
Python
py
1,622
no_license
import base import unittest from BeautifulReport import BeautifulReport import LCTJFX.test_LCTJFX_Cx import LCTJFX.test_LCTJFX_Ckrlc import LCTJFX.test_LCTJFX_Pldc if __name__=='__main__': # 构造测试套件 testunit=unittest.TestSuite() # 添加测试用例 testunit.addTest(LCTJFX.test_LCTJFX_Cx.MyTestCase_CLJK_LCTJFX_Cx(...
04f2678b5e91f33a0d2f428820bc1cfaabe87030
5b1d7cb12fba8f1e5adc19710e93730a40a61e86
FalseG0d/PyGame
/Tetris/StarterFile.py
Python
py
7,040
permissive
import pygame import random # creating the data structure for pieces # setting up global vars # functions # - create_grid # - draw_grid # - draw_window # - rotating shape in main # - setting up the main """ 10 x 20 square grid shapes: S, Z, I, O, J, L, T represented in order by 0 - 6 """ pygame.font.init() # GLOBAL...
d241430266e324f8a902bd4f3bdd24dfe655fb58
f113f788d677146aee4088d8cff9eb68466b67a7
batteryshark/py_winapi
/kernel32/fileapi.py
Python
py
1,345
no_license
import ctypes # Defines LPOVERLAPPED = ctypes.wintypes.LPVOID # Bindings k32_dll = ctypes.windll.kernel32 FlushFileBuffers = k32_dll.FlushFileBuffers FlushFileBuffers.restype = ctypes.wintypes.BOOL FlushFileBuffers.argtypes = [ctypes.wintypes.HANDLE] WriteFile = k32_dll.WriteFile WriteFile.restype = ctypes.wintypes...
e06f17495b220abe20f3682cd64dfa22189a681f
9baf205256f28a27d2ba395e2dc77d868f5a9b3a
carwestsam/leetCode
/p297/Solution.py
Python
py
3,480
no_license
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str """ ...
6e98c248ccd8219b48bab2421a28a5d3fd441e03
9efd65843bea0457ef251adc8c1e2a88c5592769
alzulas/flask-framework
/app.py
Python
py
2,192
no_license
from flask import Flask, render_template, request, redirect import requests import json from dotenv import dotenv_values import pandas as pd from bokeh.plotting import figure, show from bokeh.embed import components, server_document, file_html, json_item from bokeh.models import HoverTool from bokeh.resources import CD...
e83a3c7a4eca722bbcc0467e86e9a0b4b1dc1273
c5b0d035f8cd8918d59760deda8fc97d53eb7294
ibkalokoh/cbc_adas
/code/driver_assistance_system/4. idm_control/simulation/helpers/multi_gen_trace.py
Python
py
8,573
no_license
# MULTI_GEN_TRACE - Given the states and labels of an MDP, # the adversary generated and the states of the product of # the MDP by the DRA, obtain a trace in the original MDP # Author: Francisco Girbal Eiras, MSc Computer Science # University of Oxford, Department of Computer Science # Email: francisco.eiras@cs.ox.ac....
d515db6de2ab72e6dfa19ad56c56d224426f6b33
e1b74d60c87f9f673ebf69c499bcf9c112575282
SwimmingLee/ProblemSolving
/(Pyton)ProblemSolving/ProblemSovling/DP/[BOJ_4811]알약.py
Python
py
557
no_license
import sys input = sys.stdin.readline cache = [] def getDrug(full, half): global cache if cache[full][half] != -1: return cache[full][half] if full == 0: return 1 if half == 0: cache[full][half] = getDrug(full-1, half+1) return cache[full][half] cache[full][half]...
4413ecdada56993a9e433e2d49f29b635c3bb489
83a7a17e399d5ac8684fda2614b17b938130c973
uoshvis/scrapy-examples
/src/multi_nested_request/multi_nested_request/middlewares.py
Python
py
3,672
permissive
# Define here the models for your spider middleware # # See documentation in: # https://docs.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals # useful for handling different item types with a single interface from itemadapter import is_item, ItemAdapter class MultiNestedRequestSpiderMid...
60008afc679ac9c005608106b9170aeb39aaaac8
ac5c54ef1a7e33e494777ffbd2fd423447773941
taogeanton2/FEDOT
/setup.py
Python
py
1,554
permissive
import os from os.path import dirname, join from pathlib import Path import setuptools # The directory containing this file HERE = os.path.abspath(os.path.dirname(__file__)) # The text of the README file NAME = "fedot" VERSION = "0.3.1" AUTHOR = "NSS Lab" SHORT_DESCRIPTION = "Evolutionary structural learning framewo...
22b8d663257bdd03786acca187bc1ad1fe3ece46
59b1b259c38e5c518bbd9e95eb5e5a09aa8ad1fe
pulumi/pulumi-aws
/sdk/python/pulumi_aws/cognito/user_pool.py
Python
py
98,275
permissive
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
993bc7b3df7d8e654ba7f1a9b59fadcf5b3e3694
35a4b1d79bbdae3450c1619dd3f346dc72e5f664
LucyHut/genome-effects
/fungene/geo/browseGeoExp.py
Python
py
2,939
permissive
# -*- coding: utf-8 -*- import getopt,os,sys from geoExperiment_dom import GeoExperimentDOM def browsegeo_usage(): usage=''' Usage: PROG [-h] --geoid=gse_accession --destdir=path2/exeperiment_base Where: -h To show the usage -i gse_accession Or --geoid=gse_accession ... require...
8271824460ee2f8a1c7cc47f948cc17de292b247
e1fbe1e3c0fc72781aff68c735a397cd5fb06673
zjbreeze/ClusteringFaultPronenessTCP
/prioritization_std_runner.py
Python
py
1,237
permissive
import pandas as pd from prioritization.prioritization_manager import run_standard2_prioritization from prioritization.prioritization_clustering import clustering_agg11 from prioritization.prioritization_clustering import clustering_agg12 #projects = ['Time', 'Chart', 'Math', 'Lang', 'Closure'] #from_version = [...
2c430d85aa170adc0e23b1d0536349e5cc968590
0e5b3c426af36d32f77b2cc65befa4110509ef7f
kiwicom/the-zoo
/zoo/services/migrations/0026_link.py
Python
py
1,427
permissive
# Generated by Django 2.2.19 on 2021-04-19 11:53 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("services", "0025_remove_general_tag"), ] operations = [ migrations.CreateModel( name="Link", ...
bf79342f4ed8ecd7b340ace73e3e9fd1a474ba6d
d738a2ca53e7865e5c6fb3dbd1faed2ebaf51e4c
nuclyde-io/flyteidl
/gen/pb_python/flyteidl/service/flyteadmin/test/test_core_workflow_metadata_defaults.py
Python
py
1,060
permissive
# coding: utf-8 """ flyteidl/service/admin.proto No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: version not set Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import...
8cabcb6d82b7c283ba66e8955f2853b170deece2
d379dd8d10c0f570e8acf4b092ff089c9c11afeb
fengtianqi-GitHub/bj1910
/django/6_表单/code/day06/App01/models.py
Python
py
222
no_license
from django.db import models # Create your models here. class User(models.Model): username = models.CharField(max_length=30) password = models.CharField(max_length=128) class Meta: db_table = 'user'
a707cc61ac7ee16bc14ad619b4a976cfd809ee00
44831ed4a76d520ad33463136dfd0e6768e724a9
njaladan/2048-python
/src/gui.py
Python
py
2,278
no_license
""" 2048 GUI """ import simplegui import math import fluffy # Tile Images TILE_SIZE = 100 HALF_TILE_SIZE = TILE_SIZE / 2 BORDER_SIZE = 45 # Directions UP = 1 DOWN = 2 LEFT = 3 RIGHT = 4 class GUI: """ Class to run game GUI. """ def __init__(self, game): self._rows = game.get_grid_heigh...
6e620d735d53366ed1f216a7d9f45bcf5d53f11b
75ace9f2e79d22024f8cccee6e175eda8f80e38b
sh1ma/atcoder
/bootcamp_for_beginners/Nice Shopping/main.py
Python
py
332
no_license
def main(): A, B, M = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) xys = [tuple(map(int, input().split())) for _ in range(M)] abmin = min(a) + min(b) r = [a[xy[0] - 1] + b[xy[1] - 1] - xy[2] for xy in xys] r.append(abmin) print(min(r...
f121699e32eb4a48250c2c2071ebdeec6df947ad
0bfe92c9d9def6c7d00643caf70417c184afeae5
huangshm23/i-Robit
/beyond-end/i_robit/i_robit/urls.py
Python
py
1,426
no_license
"""i_robit URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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') Cla...
4fe3498600e5b64d2c7d1b7bbcfef847bd8ae7c4
6661f83dbe820ea098339da02a3fc8b176c13e45
admdev8/skybot
/plugins/urlhistory.py
Python
py
2,473
permissive
from __future__ import division, unicode_literals from past.utils import old_div import math import time from util import hook, urlnorm, timesince expiration_period = 60 * 60 * 24 # 1 day ignored_urls = [urlnorm.normalize("http://google.com")] def db_init(db): db.execute("create table if not exists urlhistor...
e011295081f04f713aef0ac140520f7ee9595db6
acd8f8e16dbb5c24af559b6079608cf48a1c4207
ahmadRagheb/pos_barcode_scanner
/pos_barcode_scanner/api.py
Python
py
4,643
permissive
from __future__ import unicode_literals import frappe, json from frappe.utils.nestedset import get_root_of from frappe.utils import cint from erpnext.accounts.doctype.pos_profile.pos_profile import get_item_groups from erpnext.selling.page.point_of_sale.point_of_sale import search_serial_or_batch_or_barcode_number @f...
e6e3e57ee28ff40b81485f86a1880bf7e00f094e
e6e3a9deb3785bbbf2e666891a9cd8f8b3d54f5d
raulsauaia/guia_flask
/guia_flask/usuarios/models.py
Python
py
898
no_license
from guia_flask import db, login_manager, app from flask_bcrypt import Bcrypt from flask_login import UserMixin # Model de usuário class User(db.Model,UserMixin): __tablename__ = "users" id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String) password = db.Column(db.String) email ...
d97541a3530202ded1b6f89e727ab82c5b68f644
73e8ad9bc1c03055da2cba1d80171c8de62ba0c1
webclinic017/magnet-migrade
/tests/test_platform.py
Python
py
330
permissive
import pytest def test_create_dic(): dic1 = {"name": "bob", "age": 20} dic2 = {"name": "mary"} dic = {**dic1, **dic2} assert dic["name"] == "mary" assert dic["age"] == 20 with pytest.raises( TypeError, match="got multiple values for keyword argument 'name'" ): dict(**dic1...
e32ade0ea457b0f2c558749df3ba066fe516a08c
bf67a8195d9c5350257dbf6a82c446967b24f911
sho-portfolio/machine-learning-logistic-regression
/keras-multiclass-classifier/_helper.py
Python
py
6,564
no_license
import pandas as pd import os import datetime #%matplotlib inline. ##for some reason this does not work in repl.it import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import itertools def IdentifyNonMatchingValuesBetweenDataSetsv2(df, TrainSizePercentage, tag_col, text_col): #tag_col...
3e49e96228851500f53970a9932eb315105d2b7e
581349426f67daf94a57450a22a99ab856ed5da2
charusingh21/Deep-learning
/Fashion Compatibility Computer Vision/charu_aws_final.py
Python
py
15,741
no_license
#!/usr/bin/env python # coding: utf-8 # In[10]: #!/usr/bin/env python # coding: utf-8 # In[4]: # utils.py import numpy as np import os import os.path as osp import argparse Config ={} Config['root_path'] = "./polyvore_outfits/" Config['meta_file'] = "polyvore_item_metadata.json" Config['test_file'] = "test_cate...
c6b637c1531d176582c5ecef6a17b89117acf8d8
61d269087f94ddcc7255f8e860566a485b0b5ccf
marqeta/marqeta-python
/marqeta/response_models/real_time_fee_group.py
Python
py
1,292
permissive
from datetime import datetime, date from marqeta.response_models import datetime_object import json import re class RealTimeFeeGroup(object): def __init__(self, json_response): self.json_response = json_response def __str__(self): return json.dumps(self.json_response, default=self.json_serial...
81cde7518988a47baa76bbb1759f2fdbf69a52d1
35d207f8d72c796fb24df2d86f1274a513b7d2be
CianOSull/Group_Project_2019-2020
/MediAI/Breast/BreastCancerDLN.py
Python
py
1,156
no_license
# -*- coding: utf-8 -*- """ Created on Tue Oct 15 12:51:32 2019 @author: Cian """ # first neural network with keras make predictions from numpy import loadtxt from keras.models import Sequential from keras.layers import Dense # load the dataset dataset = loadtxt('breastCancerDataset.csv', delimiter=',') # split into...
fa5125295d4e5edcc28c80e7e7b056d413aa1a4d
3f6f63a91b4e7e9805107413e4611d5e70c3cf02
mickeycj/mining-from-time-series-python
/mine_time_series_data.py
Python
py
3,601
no_license
import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.pylab import rcParams from statsmodels.tsa.arima_model import ARIMA rcParams['figure.figsize'] = 15, 6 # Set the plot's window title. def set_window_title(window_title): fig = plt.figure(0) fig.canvas.set_window_title(windo...
7a8a4fca487f351fdfb15557348a45fe08c97171
5e27b26b197f42adbf8d2e4ee88ad3249c5e42ca
walterkissling/trading_calendars
/trading_calendars/exchange_calendar_xdub.py
Python
py
3,739
permissive
# # Copyright 2018 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
a73795d91cae7e07ae780b6a3a1f1f5267d35cb3
96f9c186b7c9d983b6e86962dc552e7750111e54
zxsimple/PyTorch-On-Angel
/python/recommendation/attention_net.py
Python
py
6,071
no_license
# Tencent is pleased to support the open source community by making Angel available. # # Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. 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 o...
db5c8ab0c3dbd439917c04c888450a3f10dd742c
63829bede3c0a8449d56cb4fefc14593718d4f44
EderVs/hacker-rank
/algorithms/implementation/matrix_rotation_algo.py
Python
py
271
no_license
""" [Algo] Matrix Rotation """ def cover_to_one_dimension (matrix): if matrix != [] cover = [] cover.append(matrix[0]) return [] return [] m,n,x = map(int, raw_input().split()) matrix = [] for i in range(m): matrix.append(raw_input().split()) print matrix
5876583daf6059059d060f0c2d7d9384e54d2fa1
ba8d3fdcb97904141f879acc14b209679768e8ec
heiidii/Scripts
/RosettaAnalysis/processtraj-more.py
Python
py
18,563
no_license
import sys import os import networkx as nx import matplotlib.pyplot as plt import numpy as np import glob import mpl_toolkits #.basemap import Basemap as Basemap import cv2 basename= "Traj0split" command= "ProteinConnectivityForSampling.linuxgccdebug" n1=1 n2=102 reslist = [15]#,188] #W138, Cys188 def cleanfiles(): ...
abb5a22e2d099d230336ce3cabf51a380994b28f
8613960e7e76101f55c242965b2dba2e0f9018f5
yibitongguan/data_structure
/graph/dijkstra.py
Python
py
1,134
no_license
# encoding:utf-8 from prioQueue_heap import PrioQueue from graph import GraphAL def dijkstra_shortest_paths(graph, v0): vnum = graph.vertex_num() assert 0 <= v0 < vnum paths = [None] * vnum count = 0 # (p, v, v')表示从v0经v到v'的已知最短路径的长度为p cands = PrioQueue([(0, v0, v0)]) # 初始队列 wh...
fbbb87dc3bf000ea05b729930e6c5d440b7f7df9
fe48f1a66d845bf2890c9d1c5eb32984a32a4ca1
anirudhpillai/algorithms
/leetcode/max_increase_to_keep_city_skyline.py
Python
py
603
no_license
class Solution(object): def maxIncreaseKeepingSkyline(self, grid): """ :type grid: List[List[int]] :rtype: int """ lr_skyline = [max(row) for row in grid] tb_skyline = [] for col_idx in range(len(grid[0])): tb_skyline.append(max(row[col_id...
e5309cad2654c4916dbfdfbfd8ca9cd0afe70b15
24ee26838c9220ac662e47d0bf23c8f2b062b07a
janvimadhani/ACT-Pipeline---OLD
/correlation/hist_make.py
Python
py
2,047
no_license
from todloop.routines import Logger, DataLoader from todloop.tod import TODLoader, TODInfoLoader, TODSelector from todloop.base import TODLoop from routines import CRCorrelationFilter, FRBCorrelationFilter, SlowCorrelationFilter, DurationFilter, PixelFilter,ScatterPlot from deconv_routine import Deconvolution from cali...
3f37a0bcd22fa1ec737aed1b7a7e059f3a85fadb
6511aece0ab0a21a802793d8b3901e19ba9ae490
luojie001/Real-time-image-filtering-based-on-support-vector-machine
/produce_pic.py
Python
py
4,270
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- import os,random,glob,math from astropy.io import fits import numpy as np import scipy.stats as stats from time import time start = time() ##############cosmic_rays###################### def cosmic_rays(f,n): fmax=np.max(f) for n in range(n): dx=random.randint(0,len(f)-1) ...
f38aadd654e996bfd6c9a747d9e8943341e9f885
fb81e2302ab668166102e2701c2fb14c8adf7ca6
kelvin55/cauliflowervest
/cauliflowervest/server/util_test.py
Python
py
4,359
permissive
# Copyright 2017 Google Inc. 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 applicable law or a...
b811e61aa53a925688423ac84caa9e4927bfaacf
ab7bdea2f9e77aeda81cbf0b9196365134f1444b
zy30651/DataStructureAndAlgorithms
/day01/05栈结构实现.py
Python
py
805
no_license
# 栈可以用顺序表实现,也可以用链表实现 class Stack(object): """栈""" def __init__(self): self.items = [] def is_empty(self): """判断是否为空""" return self.items == [] def push(self, item): """加入元素""" self.items.append(item) def pop(self): """弹出元素""" self.items.pop(...
e7393676a53050dff28d0a1bb1d7aa050c7fa614
d244a59ed0ff18472e835f01d48722d28c3792c1
Diviloper/LP
/Python/Lab1/P51956.py
Python
py
944
no_license
from functools import reduce def myLength(l) -> int: i = 0 for _ in l: i += 1 return i def myMaximum(l): return reduce(lambda acc, x: acc if acc > x else x, l) def average(l): return sum(l) / len(l) def buildPalindrome(l): return list(reversed(l)) + l def remove(l1, l2): re...
0164c8a2305ceb4473ab3c8198a3fb9aca3eb973
92551a614a24937478ec24579d63d794ebe55f3d
Fordalex/supreme_raffle
/bag/contexts.py
Python
py
394
no_license
from decimal import Decimal from django.conf import settings def bag_contents(request): bag = request.session.get('bag', {}) grand_total = request.session.get('grand_total', 0) total_tickets = request.session.get('total_tickets', 0) context = { 'bag_items': bag, 'grand_total': gran...
3813d4f0a81b092e55afd84f9b0d02ade6c31abc
c2017a31dc0982b92050861c68dbca4a6a77a686
qqpann/pyml
/cifar10_cnn_train.py
Python
py
4,288
no_license
'''Train a simple deep CNN on the CIFAR10 small images dataset. GPU run command: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python cifar10_cnn.py It gets down to 0.65 test logloss in 25 epochs, and down to 0.55 after 50 epochs. (it's still underfitting at that point, though). Note: the data was pickled...
46099d36878dfc78e714aa7e6efdfda0f18dd69a
a5b63013597bd66b2e3c08787908c286c1bc970b
RandolphCisneros/DjangoBlog
/blog_project/blog/migrations/0001_initial.py
Python
py
905
no_license
# Generated by Django 2.1 on 2019-10-11 02:09 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_...
69b6f4041ab4aeedafa928a850741794967e6dae
ed9f67f1c27fa954ce523a47c214f5f57a230d9b
yama5/pythonLab-v3
/ans/5/TaxCalc.py
Python
py
428
no_license
import sys #-- taxCalc Function --# def taxCalc(price,tax=0.0): return price * (1+tax) #-- Main-Satrt --# def main(): try: price = int(sys.argv[1]) tax = float(sys.argv[2]) totalFee = taxCalc(price,tax) print('Price :',price) print('Tax :',tax) print('Total Fee...
5cf0ed661596562ac813d4028b7b8aa5fac58885
d635e2242fdd409a9a46376cea61cba5f39efb62
crowdbotics-apps/foody-mahdia-28716
/backend/manage.py
Python
py
638
no_license
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "foody_mahdia_28716.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: r...
83abe7b1e75a52d7b99b65cd3c771c32f18babe8
1aa771dbf15e2d5f1c1b447ae22df7505c0965cf
oserna3/elastickube
/src/api/v1/auth.py
Python
py
13,538
permissive
""" Copyright 2016 ElasticBox 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 applicable law or agreed to in ...
fd8cd0bd2055154984759b313575df8071cc52a3
87ab18ea71872624eeb00d4ef23d99b068ef9a37
Duplums/pynet
/bhb-10k-release/plottings.py
Python
py
97,835
permissive
from pynet.metrics import get_regression_metrics, get_binary_classification_metrics, get_multiclass_metrics import matplotlib.pyplot as plt from pynet.datasets.open_bhb import OpenBHB from pynet.open_bhb_ml.saliency_maps import plot_slices from pynet.utils import get_pickle_obj from pynet.plotting.image import plot_dat...
ee075a0f29288758eaae901a5ed3d1931c9be0db
79c3e4cfc1532b85001c55020674b10add0e12a6
danwaterfield/LeetCode-Solution
/python/Tree/Delete Tree Nodes/Delete Tree Nodes.py
Python
py
1,055
no_license
from collections import defaultdict class Solution: def deleteTreeNodes(self, nodes: int, parent: List[int], value: List[int]) -> int: child = defaultdict(list) for i, j in enumerate(parent): child[j].append(i) s = {} def dp(node): if len(child[node]) ==...
7bfeaefa7319f5480d97ad0c5c7024e1b5b13452
fcb57b90e100aff39eeed1357ddaf2db6ec41139
tedlaw09/time_series_forecaster
/other/app/extreme2_trial_1.py
Python
py
1,512
no_license
import numpy as np import tensorflow as tf from ts.data.generate.univariate.nonexo import StandardGenerator from ts.utility import Utility from ts.model.special import ExtremeTime2 from ts.plot import Plot def main(): n = 21500 trainN = 21000 seqLength = 500 numSeqPlot = 5 trainData, testData = U...
f3bbe83f2b5de17795285242f768e0c9b119c6a2
ae4bc3c5acae0513eb2fd32cc8a67ae3dff142d9
sanjaysy/Python-Autodesk-Inventor
/win32com/gen_py/D98A091D-3A0F-4C3E-B36E-61F62068D488x0x1x0/UserInputEvents.py
Python
py
1,781
no_license
# -*- coding: mbcs -*- # Created by makepy.py version 0.5.00 # By python version 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] # From type library '{D98A091D-3A0F-4C3E-B36E-61F62068D488}' # On Tue Nov 17 17:32:51 2015 """Autodesk Inventor Object Library""" makepy_version = '0.5.00' python_version ...
350fae422e46bb587bdd14d8fa58e6c8be45e268
d9138b36a373fd40e7437fce242e984c71a57645
MattBubernak/NaturalLanguageProcessing
/Assignment3/finalFiles/cross_validate.py
Python
py
1,776
no_license
#!/usr/bin/python import sys import os import fileinput import re import random # expects number of folds and the training file as the 2 inputs # also expects eval.py to be in the same directory # # divides the data into training, testing for each fold and invokes Bubernak_Phadke_IOBTagger.py to run it ...
80df6d6b7dc17f595c1e2a17c283c1e7caaaaddd
5e003d195ee4c22a67943abc3710fa9bfb3e0c8c
MyDreamProjects777/ForKapral
/main.py
Python
py
2,463
no_license
import modules.import_from_form import os.path from modules.create_default_data import WorkWithDb from urllib.parse import unquote from wsgiref.simple_server import make_server from modules.get_all_users import GetUsers def web_app(environment, response): status = '200 OK' headers = [('Content-type', 'text...
ffc5788fde0c460327ff28dfbb77559b8336a33f
042dcf39a754d847157415e187a39609411a4162
krepflap/testinfra
/testinfra/backend/__init__.py
Python
py
3,366
permissive
# coding: utf-8 # 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 writing, software # dist...
c4b1129b0e94fd1975cf771f15b942dbf6ed7257
d9ec30c2039cb881fa34cecb74c4690ce9314d29
mywork-dragon/dave-energy
/migrations/versions/7f238787ebfd_renamed_device_type_to_asset_type.py
Python
py
688
no_license
"""Renamed device_type to asset_type Revision ID: 7f238787ebfd Revises: 08741c739620 Create Date: 2020-07-13 13:00:00 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '7f238787ebfd' down_revision = '08741c739620' branch_...
c39c17cca5bb4e50a31c0e6602b76b73458b61ce
7576aded37ba7ac5251c818b854ca2e3cd2c6866
jblovett/comp110-21f-workspace
/exercises/ex01/relational_operators.py
Python
py
517
no_license
"""Relational ops""" __author__ = "730155204" left: int = int(input("Left hand side: ")) right: int = int(input("Right-hand side: ")) less: str = str(left < right) greater_or_equal: str = str(left >= right) equal: str = str(left == right) not_equal: str = str(left != right) print(str(left) + " < " + str(right) + "...
b5b2aadc53b2f5ea28055da59a3809cd13804e69
4ddbc27a58f31cd4ee6eab4fdb2896226256502b
bayramlcm/filecontentscanner
/filecontentscanner.py
Python
py
2,338
no_license
# -*- coding: utf-8 -*- #!/usr/bin/env python3 # NOTE: Created By @bayramlcm import os class scanner: def __init__(self, folder, content): self.file_count = 0; self.folder_count = 0; self._count(folder); self.founds = []; self.found_count = 0; self.buffer = 1024; ...
fbddccd48849ea166d1f1ddd2e354ce37ee70559
4ba3ed309e0acc88c6ad485906427dd42e44416d
smx83230743/PyRate
/pyrate/ref_phs_est.py
Python
py
7,339
permissive
# This Python module is part of the PyRate software package. # # Copyright 2017 Geoscience Australia # # 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/...
806f40fe2a2fb7f18f92040374b70da71dbd250d
5daa2dd1c81084794c7c5f16ecd7c7316438d2b7
lizhaoliu-Lec/Revisiting_Deep_Metric_Learning_PyTorch
/criteria/triplet.py
Python
py
1,243
permissive
import torch import torch.nn.functional as F import batchminer ALLOWED_MINING_OPS = list(batchminer.BATCHMINING_METHODS.keys()) REQUIRES_BATCHMINER = True REQUIRES_OPTIM = False class Criterion(torch.nn.Module): """ Standard Triplet Loss, finds triplets in Mini-batches. """ def __init__(self, opt, ...
b14b886e2240d7bf7047077250de55a7bef54974
930171a71a75119ef1094a81913a6a92b2b8777b
rheehot/practice
/python/problem-string/jewels_and_stones.py
Python
py
538
no_license
# https://leetcode.com/problems/jewels-and-stones # data 부족으로 %는 안 나옴 from collections import Counter class Solution: def numJewelsInStones(self, J, S): if J is None or 0 == len(J) or S is None or 0 == len(S): return 0 s, countS = 0, Counter(S) for j in J: s += countS[j] return s s = ...
a4e5a5f1585dc06d3a10b5e56e563f2b87fd37af
2cf0c7a6e55f852beba29223346ca6d77c993404
diasbruno/changelogtools
/changelogtools/tests.py
Python
py
3,243
permissive
import pytest from . import (Version, SemVer, Changelog, NotEnoughVersionsError, MissingChangelogClassError, VersionRequiresCmpMethod, VersionRequiresIsInvalidMethod, CompareVersions, adjacents, changelog) class BrokenVersion(Version): pass def test_version_require_c...
84189ac842a64346585c2fd8db1a6b0e92ed6507
788795cb46455b32d6e961b1584d83bc280c2939
MohamedJuned/aws
/node-python-roulette-master/final/list_subnets.py
Python
py
1,951
no_license
import adal import requests import psycopg2 import json import sys subscription=sys.argv[1] #dynamic dropdown resgrp=sys.argv[2] #dynamic dropdown vnet_name=sys.argv[3] #dynamic dropdown client_id = '' secret = '' tenant = '' i=0 confs=json.load(open("config.json")) entry=confs["data"] for d in entry: dat...
66afbee3169679bd6f05863bebf4e203a5312e14
6786f51fd6e165f4b4847d18d154bfd38d20e715
OrriO/jupyter_myworkspace
/ebook/xiaoxiang_Recommender_system/项目3案例与代码/movie_recommender_system/recsys_core/model_based_rec/prepare_comment_libsvm.py
Python
py
7,980
no_license
# -*- coding: utf-8 -*- import pandas as pd import pymysql import pymysql.cursors from functools import reduce import numpy as np import pandas as pd import uuid import datetime from sklearn.feature_extraction import DictVectorizer from sklearn.metrics.pairwise import pairwise_distances np.set_printoptions(precision=3...